From 33b1c522479025aa8c4241f8c6c616abde51acf9 Mon Sep 17 00:00:00 2001 From: sta Date: Wed, 15 Jun 2016 15:51:02 +0900 Subject: [PATCH] [Modify] Add it --- websocket-sharp/Net/EndPointManager.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/websocket-sharp/Net/EndPointManager.cs b/websocket-sharp/Net/EndPointManager.cs index 6558ce35..111f8721 100644 --- a/websocket-sharp/Net/EndPointManager.cs +++ b/websocket-sharp/Net/EndPointManager.cs @@ -168,6 +168,17 @@ namespace WebSocketSharp.Net getEndPointListener (addr, port, pref.IsSecure, listener).RemovePrefix (pref, listener); } + private static bool tryGetEndPointListener ( + IPAddress address, int port, out EndPointListener listener + ) + { + listener = null; + + Dictionary endpoints; + return _addressToEndpoints.TryGetValue (address, out endpoints) + && endpoints.TryGetValue (port, out listener); + } + #endregion #region Internal Methods