Fix for pull request #73, it's because 'The TcpListener.Stop method also closes the underlying Socket, and creates a new Socket for the TcpListener. If you set any properties on the underlying Socket prior to calling the Stop method, those properties will not carry over to the new Socket.'
This commit is contained in:
@@ -452,12 +452,7 @@ namespace WebSocketSharp.Server
|
||||
return;
|
||||
}
|
||||
|
||||
if (value ^ _reuseAddress) {
|
||||
_listener.Server.SetSocketOption (
|
||||
SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, value);
|
||||
|
||||
_reuseAddress = value;
|
||||
}
|
||||
_reuseAddress = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -779,6 +774,10 @@ namespace WebSocketSharp.Server
|
||||
return;
|
||||
}
|
||||
|
||||
if (_reuseAddress)
|
||||
_listener.Server.SetSocketOption (
|
||||
SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
|
||||
|
||||
_services.Start ();
|
||||
_listener.Start ();
|
||||
startReceiving ();
|
||||
|
Reference in New Issue
Block a user