Beispiel #1
0
        public InternetEndPoint(int port, System.Net.Sockets.AddressFamily addressFamily,
                                System.Net.Sockets.ProtocolType protocolType, System.Net.Sockets.ProtocolFamily protocolFamily)
            : base(protocolType, protocolFamily)
        {
            if (port < System.Net.IPEndPoint.MinPort || port > System.Net.IPEndPoint.MaxPort)
            {
                throw new System.ArgumentOutOfRangeException("port");
            }

            m_Port = port;
        }
Beispiel #2
0
        public InternetEndPoint(int port, System.Net.Sockets.AddressFamily addressFamily, System.Net.SocketAddress socketAddress,
                                System.Net.Sockets.ProtocolType protocolType, System.Net.Sockets.ProtocolFamily protocolFamily)
            : this(port, addressFamily, protocolType, protocolFamily)
        {
            if (socketAddress == null)
            {
                throw new System.ArgumentNullException("socketAddress");
            }

            if (false.Equals(socketAddress.Family == AddressFamily))
            {
                throw new System.InvalidOperationException("AddressFamily must match the socketAddress.Family");
            }

            SocketAddress = socketAddress;
        }
Beispiel #3
0
        public DnsEndPoint(string host, int port, System.Net.Sockets.AddressFamily addressFamily,
                           System.Net.Sockets.ProtocolType protocolType, System.Net.Sockets.ProtocolFamily protocolFamily)
            : base(port, addressFamily, protocolType, protocolFamily)
        {
            if (string.IsNullOrWhiteSpace(host))
            {
                throw new System.ArgumentException("Cannot be null or consist only of whitespace", "host");
            }

            if (false.Equals(m_Family == System.Net.Sockets.AddressFamily.InterNetwork)
                &&
                false.Equals(m_Family == System.Net.Sockets.AddressFamily.InterNetworkV6))
            {
                throw new System.ArgumentException("Invalid Address Family", "addressFamily");
            }

            m_Host = host;

            m_Family = addressFamily;
        }
Beispiel #4
0
 public SocketEndPoint(System.Net.Sockets.ProtocolType protocolType, System.Net.Sockets.ProtocolFamily protocolFamily)
     : this(protocolType)
 {
     ProtocolFamily = protocolFamily;
 }