internal static void RemoveEndPoint(EndPointListener epl, IPEndPoint ep) { if (IPToEndpoints.TryGetValue(ep.Address, out var p)) { if (p.TryRemove(ep.Port, out _) && p.Count == 0) { IPToEndpoints.TryRemove(ep.Address, out _); } } epl.Close(); }
public static void RemoveEndPoint(EndPointListener epl, IPEndPoint ep) { lock (ip_to_endpoints) { // Dictionary<int, EndPointListener> p Hashtable p = null; p = (Hashtable)ip_to_endpoints[ep.Address]; p.Remove(ep.Port); if (p.Count == 0) { ip_to_endpoints.Remove(ep.Address); } epl.Close(); } }
public static void RemoveEndPoint(EndPointListener epl, IPEndPoint ep) { lock (ip_to_endpoints) { // Dictionary<int, EndPointListener> p Hashtable p = null; p = (Hashtable)ip_to_endpoints[ep.Address]; p.Remove(ep.Port); if (p.Count == 0) { ip_to_endpoints.Remove(ep.Address); } epl.Close(); } }
internal static void RemoveEndPoint(EndPointListener listener) { lock (((ICollection) _addressToEndpoints).SyncRoot) { var addr = listener.Address; var eps = _addressToEndpoints[addr]; eps.Remove (listener.Port); if (eps.Count == 0) _addressToEndpoints.Remove (addr); listener.Close (); } }
public static void RemoveEndPoint(EndPointListener epListener, IPEndPoint endpoint) { lock (((ICollection) _ipToEndpoints).SyncRoot) { var eps = _ipToEndpoints[endpoint.Address]; eps.Remove (endpoint.Port); if (eps.Count == 0) _ipToEndpoints.Remove (endpoint.Address); epListener.Close (); } }
public static void RemoveEndPoint (EndPointListener epl, IPEndPoint ep) { lock (((ICollection)ip_to_endpoints).SyncRoot) { Dictionary<int, EndPointListener> p = null; p = ip_to_endpoints [ep.Address]; p.Remove (ep.Port); if (p.Count == 0) { ip_to_endpoints.Remove (ep.Address); } epl.Close (); } }