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