[Modify] Polish it
This commit is contained in:
parent
963db4bdf0
commit
e8a0edfeb7
@ -603,14 +603,22 @@ namespace WebSocketSharp.Server
|
|||||||
private void abort ()
|
private void abort ()
|
||||||
{
|
{
|
||||||
lock (_sync) {
|
lock (_sync) {
|
||||||
if (!IsListening)
|
if (_state != ServerState.Start)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_state = ServerState.ShuttingDown;
|
_state = ServerState.ShuttingDown;
|
||||||
}
|
}
|
||||||
|
|
||||||
_services.Stop (new CloseEventArgs (CloseStatusCode.ServerError), true, false);
|
try {
|
||||||
|
try {
|
||||||
|
_services.Stop (1006, String.Empty);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
_listener.Abort ();
|
_listener.Abort ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
}
|
||||||
|
|
||||||
_state = ServerState.Stop;
|
_state = ServerState.Stop;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user