HDFS-11533. reuseAddress option should be used for child channels in Portmap and SimpleTcpServer. Contributed by Mukul Kumar Singh.

This commit is contained in:
Jitendra Pandey 2017-03-16 11:40:12 -07:00
parent 79ede403ee
commit 09ad8effb8
2 changed files with 2 additions and 0 deletions

View File

@ -81,6 +81,7 @@ public ChannelPipeline getPipeline() throws Exception {
}); });
server.setOption("child.tcpNoDelay", true); server.setOption("child.tcpNoDelay", true);
server.setOption("child.keepAlive", true); server.setOption("child.keepAlive", true);
server.setOption("child.reuseAddress", true);
server.setOption("reuseAddress", true); server.setOption("reuseAddress", true);
// Listen to TCP port // Listen to TCP port

View File

@ -110,6 +110,7 @@ public ChannelPipeline getPipeline() throws Exception {
} }
}); });
tcpServer.setOption("reuseAddress", true); tcpServer.setOption("reuseAddress", true);
tcpServer.setOption("child.reuseAddress", true);
udpServer = new ConnectionlessBootstrap(new NioDatagramChannelFactory( udpServer = new ConnectionlessBootstrap(new NioDatagramChannelFactory(
Executors.newCachedThreadPool())); Executors.newCachedThreadPool()));