[Modify] Replace it
This commit is contained in:
parent
90ddd792b9
commit
372aca103b
@ -1043,36 +1043,12 @@ namespace WebSocketSharp.Server
|
||||
public void Stop (ushort code, string reason)
|
||||
{
|
||||
string msg;
|
||||
if (!checkIfAvailable (false, true, false, false, out msg)) {
|
||||
_log.Error (msg);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!WebSocket.CheckParametersForClose (code, reason, false, out msg)) {
|
||||
_log.Error (msg);
|
||||
return;
|
||||
}
|
||||
|
||||
lock (_sync) {
|
||||
if (!checkIfAvailable (false, true, false, false, out msg)) {
|
||||
_log.Error (msg);
|
||||
return;
|
||||
}
|
||||
|
||||
_state = ServerState.ShuttingDown;
|
||||
}
|
||||
|
||||
if (code == (ushort) CloseStatusCode.NoStatus) {
|
||||
_services.Stop (new CloseEventArgs (), true, true);
|
||||
}
|
||||
else {
|
||||
var send = !code.IsReserved ();
|
||||
_services.Stop (new CloseEventArgs (code, reason), send, send);
|
||||
}
|
||||
|
||||
stopReceiving (5000);
|
||||
|
||||
_state = ServerState.Stop;
|
||||
stop (code, reason);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user