[Modify] Replace it

This commit is contained in:
sta 2021-04-19 21:35:33 +09:00
parent ff4686c128
commit b6816681f2

View File

@ -505,12 +505,13 @@ namespace WebSocketSharp.Net
if (!_listening) if (!_listening)
throw new HttpListenerException (995); throw new HttpListenerException (995);
var ctx = getContextFromQueue (); if (_contextQueue.Count == 0) {
if (ctx == null)
_waitQueue.Enqueue (asyncResult); _waitQueue.Enqueue (asyncResult);
else }
else {
var ctx = _contextQueue.Dequeue ();
asyncResult.Complete (ctx, true); asyncResult.Complete (ctx, true);
}
return asyncResult; return asyncResult;
} }