[Modify] Polish it

This commit is contained in:
sta 2021-08-29 21:05:38 +09:00
parent 911d58872d
commit 9941505063

View File

@ -873,11 +873,13 @@ namespace WebSocketSharp.Server
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.");
return; return;
} }
if (_state == ServerState.ShuttingDown) { if (_state == ServerState.ShuttingDown) {
_log.Warn ("The server is shutting down."); _log.Warn ("The server is shutting down.");
return; return;
} }
@ -885,11 +887,13 @@ namespace WebSocketSharp.Server
_realmInUse = getRealm (); _realmInUse = getRealm ();
_services.Start (); _services.Start ();
try { try {
startReceiving (); startReceiving ();
} }
catch { catch {
_services.Stop (1011, String.Empty); _services.Stop (1011, String.Empty);
throw; throw;
} }