Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Create()

override EndPoint System.Net.IPEndPoint.Create ( SocketAddress socketAddress)
inlinevirtual

Reimplemented from System.Net.EndPoint.

Definition at line 133 of file IPEndPoint.cs.

134 {
135 if (socketAddress == null)
136 {
137 throw new ArgumentNullException("socketAddress");
138 }
139 if (socketAddress.Family != AddressFamily)
140 {
141 throw new ArgumentException(System.SR.Format(System.SR.net_InvalidAddressFamily, socketAddress.Family.ToString(), GetType().FullName, AddressFamily.ToString()), "socketAddress");
142 }
143 int num = ((AddressFamily == AddressFamily.InterNetworkV6) ? SocketAddress.IPv6AddressSize : SocketAddress.IPv4AddressSize);
144 if (socketAddress.Size < num)
145 {
146 throw new ArgumentException(System.SR.Format(System.SR.net_InvalidSocketAddressSize, socketAddress.GetType().FullName, GetType().FullName), "socketAddress");
147 }
148 return socketAddress.GetIPEndPoint();
149 }
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string net_InvalidSocketAddressSize
Definition SR.cs:22
static string net_InvalidAddressFamily
Definition SR.cs:20
Definition SR.cs:7

References System.Net.SocketAddress.Family, System.SR.Format(), System.FullName, System.Net.SocketAddress.GetIPEndPoint(), System.Net.SocketAddress.IPv4AddressSize, System.Net.SocketAddress.IPv6AddressSize, System.SR.net_InvalidAddressFamily, System.SR.net_InvalidSocketAddressSize, and System.Net.SocketAddress.Size.

Referenced by Interop.HttpApi.GetRemoteEndPoint().