[Modify] Polish it
This commit is contained in:
parent
928fd0755f
commit
dc420c7b7e
@ -433,22 +433,18 @@ namespace WebSocketSharp.Net
|
|||||||
|
|
||||||
private void cleanupContextRegistry ()
|
private void cleanupContextRegistry ()
|
||||||
{
|
{
|
||||||
HttpListenerContext[] ctxs = null;
|
var cnt = _contextRegistry.Count;
|
||||||
|
|
||||||
lock (_contextRegistrySync) {
|
if (cnt == 0)
|
||||||
var cnt = _contextRegistry.Count;
|
return;
|
||||||
|
|
||||||
if (cnt == 0)
|
var ctxs = new HttpListenerContext[cnt];
|
||||||
return;
|
_contextRegistry.CopyTo (ctxs, 0);
|
||||||
|
|
||||||
ctxs = new HttpListenerContext[cnt];
|
_contextRegistry.Clear ();
|
||||||
_contextRegistry.CopyTo (ctxs, 0);
|
|
||||||
|
|
||||||
_contextRegistry.Clear ();
|
foreach (var ctx in ctxs)
|
||||||
}
|
ctx.Connection.Close (true);
|
||||||
|
|
||||||
for (var i = ctxs.Length - 1; i >= 0; i--)
|
|
||||||
ctxs[i].Connection.Close (true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cleanupWaitQueue (Exception exception)
|
private void cleanupWaitQueue (Exception exception)
|
||||||
|
Loading…
Reference in New Issue
Block a user