[Modify] Polish it

This commit is contained in:
sta 2021-12-24 22:14:05 +09:00
parent ef33547bec
commit 50ae677b2d

View File

@ -910,17 +910,8 @@ namespace WebSocketSharp.Server
private void stop (ushort code, string reason) private void stop (ushort code, string reason)
{ {
lock (_sync) { lock (_sync) {
if (_state == ServerState.ShuttingDown) { if (_state != ServerState.Start)
_log.Info ("The server is shutting down.");
return; return;
}
if (_state == ServerState.Stop) {
_log.Info ("The server has already stopped.");
return;
}
_state = ServerState.ShuttingDown; _state = ServerState.ShuttingDown;
} }