Set SO_REUSEADDR on TCP servers, as in MRI. Fixes #378.
This commit is contained in:
parent
657dafdcff
commit
4d7548c275
|
@ -101,6 +101,8 @@ public class RubyTCPServer extends RubyTCPSocket {
|
|||
InetAddress addr = InetAddress.getByName(host);
|
||||
|
||||
ServerSocketChannel ssc = ServerSocketChannel.open();
|
||||
ssc.socket().setReuseAddress(true);
|
||||
|
||||
InetSocketAddress socket_address = new InetSocketAddress(addr, port);
|
||||
|
||||
ssc.socket().bind(socket_address);
|
||||
|
|
Loading…
Reference in New Issue