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

◆ IPAddress() [7/7]

System.Net.IPAddress.IPAddress ( ReadOnlySpan< byte > address)
inline

Definition at line 284 of file IPAddress.cs.

285 {
286 if (address.Length == 4)
287 {
288 PrivateAddress = MemoryMarshal.Read<uint>(address);
289 return;
290 }
291 if (address.Length == 16)
292 {
293 _numbers = new ushort[8];
294 for (int i = 0; i < 8; i++)
295 {
296 _numbers[i] = (ushort)(address[i * 2] * 256 + address[i * 2 + 1]);
297 }
298 return;
299 }
300 throw new ArgumentException(System.SR.dns_bad_ip_address, "address");
301 }
readonly ushort[] _numbers
Definition IPAddress.cs:49
static string dns_bad_ip_address
Definition SR.cs:28
Definition SR.cs:7

References System.Net.IPAddress._numbers, System.SR.dns_bad_ip_address, System.ReadOnlySpan< T >.Length, and System.Net.IPAddress.PrivateAddress.