[Modify] Polish it
This commit is contained in:
parent
d05afaeea1
commit
6b8b0ba745
@ -1053,24 +1053,6 @@ namespace WebSocketSharp.Server
|
||||
|
||||
private void stop (ushort code, string reason)
|
||||
{
|
||||
if (_state == ServerState.Ready) {
|
||||
_log.Info ("The server is not started.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (_state == ServerState.ShuttingDown) {
|
||||
_log.Info ("The server is shutting down.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (_state == ServerState.Stop) {
|
||||
_log.Info ("The server has already stopped.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
lock (_sync) {
|
||||
if (_state == ServerState.ShuttingDown) {
|
||||
_log.Info ("The server is shutting down.");
|
||||
@ -1477,6 +1459,24 @@ namespace WebSocketSharp.Server
|
||||
/// </summary>
|
||||
public void Stop ()
|
||||
{
|
||||
if (_state == ServerState.Ready) {
|
||||
_log.Info ("The server is not started.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (_state == ServerState.ShuttingDown) {
|
||||
_log.Info ("The server is shutting down.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (_state == ServerState.Stop) {
|
||||
_log.Info ("The server has already stopped.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
stop (1001, String.Empty);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user