diff --git a/websocket-sharp/Net/HttpListener.cs b/websocket-sharp/Net/HttpListener.cs index 37c83628..6e9ff470 100644 --- a/websocket-sharp/Net/HttpListener.cs +++ b/websocket-sharp/Net/HttpListener.cs @@ -465,6 +465,21 @@ namespace WebSocketSharp.Net ares.Complete (ex); } + private void cleanupWaitQueue (Exception exception) + { + HttpListenerAsyncResult[] aress = null; + lock (_waitQueueSync) { + if (_waitQueue.Count == 0) + return; + + aress = _waitQueue.ToArray (); + _waitQueue.Clear (); + } + + foreach (var ares in aress) + ares.Complete (exception); + } + private void close (bool force) { EndPointManager.RemoveListener (this);