parent
d879d983ce
commit
20ad884dbe
@ -433,19 +433,21 @@ namespace WebSocketSharp.Net
|
|||||||
|
|
||||||
private void cleanupContextRegistry ()
|
private void cleanupContextRegistry ()
|
||||||
{
|
{
|
||||||
|
HttpListenerContext[] ctxs = null;
|
||||||
lock (_ctxRegistrySync) {
|
lock (_ctxRegistrySync) {
|
||||||
if (_ctxRegistry.Count == 0)
|
if (_ctxRegistry.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Need to copy this since closing will call the UnregisterContext method.
|
// Need to copy this since closing will call the UnregisterContext method.
|
||||||
var keys = _ctxRegistry.Keys;
|
var keys = _ctxRegistry.Keys;
|
||||||
var ctxs = new HttpListenerContext[keys.Count];
|
ctxs = new HttpListenerContext[keys.Count];
|
||||||
keys.CopyTo (ctxs, 0);
|
keys.CopyTo (ctxs, 0);
|
||||||
_ctxRegistry.Clear ();
|
_ctxRegistry.Clear ();
|
||||||
|
}
|
||||||
|
|
||||||
for (var i = ctxs.Length - 1; i >= 0; i--)
|
for (var i = ctxs.Length - 1; i >= 0; i--)
|
||||||
ctxs[i].Connection.Close (true);
|
ctxs[i].Connection.Close (true);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void cleanupWaitQueue ()
|
private void cleanupWaitQueue ()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user