public int BindRandomPort([NotNull] string addr)
{
string address, protocol;
DecodeAddress(addr, out address, out protocol);
if (protocol != Address.TcpProtocol)
throw new ProtocolNotSupportedException("Address must use the TCP protocol.");
Bind(addr + ":0");
return m_port;
}