Skip to content

Commit

Permalink
ZOOKEEPER-4728: force to re-resolve hostname into IP when binding
Browse files Browse the repository at this point in the history
  • Loading branch information
showuon committed Jul 31, 2023
1 parent 52b2fbc commit 12f7f63
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ Optional<ServerSocket> createServerSocket(InetSocketAddress address, boolean por
serverSocket = new ServerSocket();
}
serverSocket.setReuseAddress(true);
serverSocket.bind(address);
serverSocket.bind(new InetSocketAddress(address.getHostString(), address.getPort()));
return Optional.of(serverSocket);
} catch (IOException e) {
LOG.error("Couldn't bind to {}", address.toString(), e);
Expand Down

0 comments on commit 12f7f63

Please sign in to comment.