Beispiel #1
0
        public override string ToString()
        {
            if (_fd == null)
            {
                return("<closed>");
            }

            string s;

            if (_incoming && !_bound)
            {
                s = "local address = " + Network.AddrToString(_addr);
            }
            else if (_state == StateNotConnected)
            {
                s = "local address = " + Network.LocalAddrToString(Network.GetLocalAddress(_fd));
                if (_peerAddr != null)
                {
                    s += "\nremote address = " + Network.AddrToString(_peerAddr);
                }
            }
            else
            {
                s = Network.FdToString(_fd);
            }

            if (_mcastAddr != null)
            {
                s += "\nmulticast address = " + Network.AddrToString(_mcastAddr);
            }
            return(s);
        }
Beispiel #2
0
 public override string ToString() => Network.AddrToString(_proxy == null ? _addr : _proxy.GetAddress());
Beispiel #3
0
 public override string ToString() => Network.AddrToString(_addr);