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