[Fix] Use try-finally

This commit is contained in:
sta 2017-02-02 17:37:20 +09:00
parent 4f3f165fc0
commit 262922f049

View File

@ -904,10 +904,17 @@ namespace WebSocketSharp.Server
_state = ServerState.ShuttingDown;
}
stopReceiving (5000);
_services.Stop (code, reason);
_state = ServerState.Stop;
try {
try {
stopReceiving (5000);
}
finally {
_services.Stop (code, reason);
}
}
finally {
_state = ServerState.Stop;
}
}
private void stopReceiving (int millisecondsTimeout)