/// <summary> /// Generates a new IPSocket based on the given IPEndPoint. /// </summary> /// <param name="IPEndPoint">An IPEndPoint.</param> public IPSocket(IPEndPoint IPEndPoint) { this.IPAddress = IPAddressHelper.Build(IPEndPoint.Address.GetAddressBytes()); this.Port = new IPPort((UInt16)IPEndPoint.Port); }
/// <summary> /// A socket on localhost and the given port. /// </summary> /// <param name="Port">The IP port.</param> public static IPSocket Localhost(IPPort Port) => new IPSocket(IPv4Address.Localhost, Port);
/// <summary> /// Generates a new IPSocket based on the given IPAddress and IPPort. /// </summary> /// <param name="IPAddress">The IPAdress of the socket.</param> /// <param name="Port">The port of the socket.</param> public IPSocket(IIPAddress IPAddress, IPPort Port) { this.IPAddress = IPAddress; this.Port = Port; }