[Modify] Replace it
This commit is contained in:
parent
030063ccc6
commit
97c6889696
@ -854,11 +854,19 @@ namespace WebSocketSharp.Server
|
||||
/// </param>
|
||||
public void Stop (ushort 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;
|
||||
}
|
||||
@ -867,6 +875,7 @@ namespace WebSocketSharp.Server
|
||||
}
|
||||
|
||||
stopReceiving (5000);
|
||||
|
||||
if (code == (ushort) CloseStatusCode.NoStatus) {
|
||||
_services.Stop (new CloseEventArgs (), true, true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user