[Modify] Add it

This commit is contained in:
sta 2021-05-25 15:52:51 +09:00
parent 4910051171
commit bcd67362ed

View File

@ -487,6 +487,28 @@ namespace WebSocketSharp.Net
#region Private Methods
private HttpListenerAsyncResult beginGetContext (
AsyncCallback callback, object state
)
{
lock (_contextRegistrySync) {
if (!_listening)
throw new HttpListenerException (995);
var ares = new HttpListenerAsyncResult (callback, state);
if (_contextQueue.Count == 0) {
_waitQueue.Enqueue (ares);
}
else {
var ctx = _contextQueue.Dequeue ();
ares.Complete (ctx, true);
}
return ares;
}
}
private void cleanupContextQueue (bool force)
{
if (_contextQueue.Count == 0)