[Modify] Do not throw

This commit is contained in:
sta
2021-12-27 21:24:12 +09:00
parent 7be15df2ce
commit ca78024530

View File

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