Skip to content

Commit

Permalink
HDFS-11387. Socket reuse address option is not honored in PrivilegedN…
Browse files Browse the repository at this point in the history
…fsGatewayStarter. Contributed by Mukul Kumar Singh.
  • Loading branch information
arp7 committed Feb 3, 2017
1 parent 0914fcc commit e023584
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ public void init(DaemonContext context) throws Exception {
}

try {
registrationSocket = new DatagramSocket(
new InetSocketAddress("localhost", clientPort));
InetSocketAddress socketAddress =
new InetSocketAddress("localhost", clientPort);
registrationSocket = new DatagramSocket(null);
registrationSocket.setReuseAddress(true);
registrationSocket.bind(socketAddress);
} catch (SocketException e) {
LOG.error("Init failed for port=" + clientPort, e);
throw e;
Expand Down

0 comments on commit e023584

Please sign in to comment.