[Modify] Do not throw

This commit is contained in:
sta 2022-01-06 21:10:20 +09:00
parent b5d62e06cd
commit 06edc3beae

View File

@ -1012,31 +1012,24 @@ namespace WebSocketSharp.Server
_state = ServerState.ShuttingDown;
}
try {
var threw = false;
try {
_services.Stop (code, reason);
}
catch {
threw = true;
throw;
catch (Exception ex) {
_log.Fatal (ex.Message);
_log.Debug (ex.ToString ());
}
finally {
try {
stopReceiving (5000);
}
catch {
if (!threw)
throw;
catch (Exception ex) {
_log.Fatal (ex.Message);
_log.Debug (ex.ToString ());
}
}
}
finally {
_state = ServerState.Stop;
}
}
private void stopReceiving (int millisecondsTimeout)
{