[Modify] Lock it
This commit is contained in:
parent
3447e69286
commit
9bf82164e0
@ -800,17 +800,20 @@ namespace WebSocketSharp.Net
|
|||||||
if (!_listening)
|
if (!_listening)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_listening = false;
|
lock (_contextRegistrySync) {
|
||||||
|
if (!_listening)
|
||||||
|
return;
|
||||||
|
|
||||||
EndPointManager.RemoveListener (this);
|
EndPointManager.RemoveListener (this);
|
||||||
|
|
||||||
lock (_contextRegistrySync)
|
|
||||||
cleanupContextQueue (true);
|
cleanupContextQueue (true);
|
||||||
|
cleanupContextRegistry ();
|
||||||
|
|
||||||
cleanupContextRegistry ();
|
var ex = new HttpListenerException (995, "The listener is stopped.");
|
||||||
|
cleanupWaitQueue (ex);
|
||||||
|
|
||||||
var ex = new HttpListenerException (995, "The listener is stopped.");
|
_listening = false;
|
||||||
cleanupWaitQueue (ex);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
Loading…
Reference in New Issue
Block a user