388 {
389 int num = 0;
390 for (global::Interop.Winsock.AddressInfoEx* ptr = addressInfoExPtr; ptr != null; ptr = ptr->ai_next)
391 {
392 int num2 = (int)ptr->ai_addrlen;
394 {
395 if (num2 == 16)
396 {
397 num++;
398 }
399 }
400 else if (SocketProtocolSupportPal.OSSupportsIPv6 && ptr->ai_family ==
AddressFamily.InterNetworkV6 && num2 == 28)
401 {
402 num++;
403 }
404 }
405 IPAddress[]
array =
new IPAddress[num];
406 num = 0;
407 string text = (justAddresses ?
"NONNULLSENTINEL" :
null);
408 for (global::Interop.Winsock.AddressInfoEx* ptr2 = addressInfoExPtr; ptr2 != null; ptr2 = ptr2->ai_next)
409 {
410 if (
text ==
null && ptr2->ai_canonname !=
IntPtr.Zero)
411 {
413 }
414 int num3 = (int)ptr2->ai_addrlen;
415 ReadOnlySpan<byte> socketAddress = new ReadOnlySpan<byte>(ptr2->ai_addr, num3);
417 {
418 if (num3 == 16)
419 {
421 }
422 }
423 else if (SocketProtocolSupportPal.OSSupportsIPv6 && ptr2->ai_family ==
AddressFamily.InterNetworkV6 && num3 == 28)
424 {
426 }
427 }
428 hostName = (justAddresses ? null :
text);
430 }
static IPAddress CreateIPv6Address(ReadOnlySpan< byte > socketAddress)
static IPAddress CreateIPv4Address(ReadOnlySpan< byte > socketAddress)
static unsafe? string PtrToStringUni(IntPtr ptr)