[Modify] Polish it
This commit is contained in:
parent
bcca8707e6
commit
76e961629e
@ -190,7 +190,11 @@ namespace WebSocketSharp.Net
|
|||||||
{
|
{
|
||||||
lock (((ICollection) _addressToEndpoints).SyncRoot) {
|
lock (((ICollection) _addressToEndpoints).SyncRoot) {
|
||||||
var addr = listener.Address;
|
var addr = listener.Address;
|
||||||
var endpoints = _addressToEndpoints[addr];
|
|
||||||
|
Dictionary<int, EndPointListener> endpoints;
|
||||||
|
if (!_addressToEndpoints.TryGetValue (addr, out endpoints))
|
||||||
|
return;
|
||||||
|
|
||||||
endpoints.Remove (listener.Port);
|
endpoints.Remove (listener.Port);
|
||||||
if (endpoints.Count == 0)
|
if (endpoints.Count == 0)
|
||||||
_addressToEndpoints.Remove (addr);
|
_addressToEndpoints.Remove (addr);
|
||||||
|
Loading…
Reference in New Issue
Block a user