HDFS-11479. Socket re-use address option should be used in SimpleUdpServer. Contributed by Mukul Kumar Singh.

This commit is contained in:
Arpit Agarwal 2017-03-01 12:59:02 -08:00
parent 82ef9accaf
commit 899d5c4d49

View File

@ -63,6 +63,7 @@ public void run() {
server.setOption("broadcast", "false"); server.setOption("broadcast", "false");
server.setOption("sendBufferSize", SEND_BUFFER_SIZE); server.setOption("sendBufferSize", SEND_BUFFER_SIZE);
server.setOption("receiveBufferSize", RECEIVE_BUFFER_SIZE); server.setOption("receiveBufferSize", RECEIVE_BUFFER_SIZE);
server.setOption("reuseAddress", true);
// Listen to the UDP port // Listen to the UDP port
ch = server.bind(new InetSocketAddress(port)); ch = server.bind(new InetSocketAddress(port));