示例#1
0
        public string ToDetailedString()
        {
            var           s = new StringBuilder(ToString());
            List <string> intfs;

            if (_mcastAddr == null)
            {
                intfs = Network.GetHostsForEndpointExpand(Network.EndpointAddressToString(_addr),
                                                          _instance.IPVersion, true);
            }
            else
            {
                Debug.Assert(_mcastInterface != null);
                intfs = Network.GetInterfacesForMulticast(_mcastInterface,
                                                          Network.GetIPVersion(_mcastAddr.Address));
            }

            if (intfs.Count != 0)
            {
                s.Append("\nlocal interfaces = ");
                s.Append(string.Join(", ", intfs.ToArray()));
            }
            return(s.ToString());
        }