Skip to content

Commit

Permalink
KristianRosenvold: Revised localhost resolution
Browse files Browse the repository at this point in the history
Avoids dns for localhost resolution. Fix suggested by Barnard B

r16510
  • Loading branch information
krosenvold committed Apr 10, 2012
1 parent 5a53dbd commit 9f54721
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ protected int determineNextFreePort(int port) {

for (newport = port; newport < port + 200; newport++) {
Socket socket = new Socket();
InetSocketAddress address = new InetSocketAddress("localhost", newport);
InetSocketAddress address = new InetSocketAddress(networkUtils.obtainLoopbackIp4Address(),
newport);

try {
socket.bind(address);
Expand Down

0 comments on commit 9f54721

Please sign in to comment.