|
|
|
|
@ -581,12 +581,17 @@ namespace WebSocketSharp.Net
|
|
|
|
|
throw new ObjectDisposedException (GetType ().ToString ());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal void RegisterContext (HttpListenerContext context)
|
|
|
|
|
internal bool RegisterContext (HttpListenerContext context)
|
|
|
|
|
{
|
|
|
|
|
lock (_ctxRegistrySync)
|
|
|
|
|
_ctxRegistry[context] = context;
|
|
|
|
|
if (!_listening)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
HttpListenerAsyncResult ares = null;
|
|
|
|
|
lock (_ctxRegistrySync) {
|
|
|
|
|
if (!_listening)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
_ctxRegistry[context] = context;
|
|
|
|
|
lock (_waitQueueSync) {
|
|
|
|
|
if (_waitQueue.Count == 0) {
|
|
|
|
|
lock (_ctxQueueSync)
|
|
|
|
|
@ -597,9 +602,12 @@ namespace WebSocketSharp.Net
|
|
|
|
|
_waitQueue.RemoveAt (0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ares != null)
|
|
|
|
|
ares.Complete (context);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal void RemoveConnection (HttpConnection connection)
|
|
|
|
|
|