[Modify] Move them

This commit is contained in:
sta 2020-10-15 20:03:14 +09:00
parent 94ca3ee723
commit 067f2cd4f9
2 changed files with 4 additions and 10 deletions

View File

@ -222,7 +222,7 @@ namespace WebSocketSharp.Net
if (prefs != null && prefs.Count > 0)
return;
EndPointManager.RemoveEndPoint (_endpoint);
Close ();
}
private static void onAccept (IAsyncResult asyncResult)
@ -484,6 +484,8 @@ namespace WebSocketSharp.Net
for (var i = conns.Length - 1; i >= 0; i--)
conns[i].Close (true);
EndPointManager.RemoveEndPoint (_endpoint);
}
public void RemovePrefix (HttpListenerPrefix prefix)

View File

@ -208,17 +208,9 @@ namespace WebSocketSharp.Net
internal static bool RemoveEndPoint (IPEndPoint endpoint)
{
lock (((ICollection) _endpoints).SyncRoot) {
EndPointListener lsnr;
if (!_endpoints.TryGetValue (endpoint, out lsnr))
return false;
lsnr.Close ();
lock (((ICollection) _endpoints).SyncRoot)
return _endpoints.Remove (endpoint);
}
}
#endregion