[Modify] Polish it

This commit is contained in:
sta 2021-08-06 21:41:22 +09:00
parent 6b8b0ba745
commit 5faf02fd11

View File

@ -994,18 +994,6 @@ namespace WebSocketSharp.Server
private void start () private void start ()
{ {
if (_state == ServerState.Start) {
_log.Info ("The server has already started.");
return;
}
if (_state == ServerState.ShuttingDown) {
_log.Warn ("The server is shutting down.");
return;
}
lock (_sync) { lock (_sync) {
if (_state == ServerState.Start) { if (_state == ServerState.Start) {
_log.Info ("The server has already started."); _log.Info ("The server has already started.");
@ -1451,6 +1439,18 @@ namespace WebSocketSharp.Server
throw new InvalidOperationException (msg); throw new InvalidOperationException (msg);
} }
if (_state == ServerState.Start) {
_log.Info ("The server has already started.");
return;
}
if (_state == ServerState.ShuttingDown) {
_log.Warn ("The server is shutting down.");
return;
}
start (); start ();
} }