[Modify] Replace it
This commit is contained in:
parent
91f090645a
commit
3b213b4abb
@ -906,11 +906,19 @@ namespace WebSocketSharp.Server
|
||||
/// </param>
|
||||
public void Stop (CloseStatusCode code, string reason)
|
||||
{
|
||||
lock (_sync) {
|
||||
var msg = _state.CheckIfAvailable (false, true, false) ??
|
||||
WebSocket.CheckCloseParameters (code, reason, false);
|
||||
string msg;
|
||||
if (!checkIfAvailable (false, true, false, false, out msg)) {
|
||||
_logger.Error (msg);
|
||||
return;
|
||||
}
|
||||
|
||||
if (msg != null) {
|
||||
if (!WebSocket.CheckParametersForClose (code, reason, false, out msg)) {
|
||||
_logger.Error (msg);
|
||||
return;
|
||||
}
|
||||
|
||||
lock (_sync) {
|
||||
if (!checkIfAvailable (false, true, false, false, out msg)) {
|
||||
_logger.Error (msg);
|
||||
return;
|
||||
}
|
||||
@ -919,6 +927,7 @@ namespace WebSocketSharp.Server
|
||||
}
|
||||
|
||||
stopReceiving (5000);
|
||||
|
||||
if (code == CloseStatusCode.NoStatus) {
|
||||
_services.Stop (new CloseEventArgs (), true, true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user