public Endpoint FindEndpoint([NotNull] string addr)
{
Debug.Assert(addr != null);
lock (m_endpointsSync)
{
if (!m_endpoints.ContainsKey(addr))
throw new EndpointNotFoundException();
var endpoint = m_endpoints[addr];
if (endpoint == null)
throw new EndpointNotFoundException();
// Increment the command sequence number of the peer so that it won't
// get deallocated until "bind" command is issued by the caller.
// The subsequent 'bind' has to be called with inc_seqnum parameter
// set to false, so that the seqnum isn't incremented twice.
endpoint.Socket.IncSeqnum();
return endpoint;
}
}
}