343 {
344 int num = 0;
345 for (global::Interop.Winsock.AddressInfo* ptr = addressInfoPtr; ptr != null; ptr = ptr->ai_next)
346 {
347 int num2 = (int)ptr->ai_addrlen;
349 {
350 if (num2 == 16)
351 {
352 num++;
353 }
354 }
355 else if (SocketProtocolSupportPal.OSSupportsIPv6 && ptr->ai_family ==
AddressFamily.InterNetworkV6 && num2 == 28)
356 {
357 num++;
358 }
359 }
360 IPAddress[]
array =
new IPAddress[num];
361 num = 0;
362 string text = (justAddresses ?
"NONNULLSENTINEL" :
null);
363 for (global::Interop.Winsock.AddressInfo* ptr2 = addressInfoPtr; ptr2 != null; ptr2 = ptr2->ai_next)
364 {
365 if (
text ==
null && ptr2->ai_canonname !=
null)
366 {
368 }
369 int num3 = (int)ptr2->ai_addrlen;
370 ReadOnlySpan<byte> socketAddress = new ReadOnlySpan<byte>(ptr2->ai_addr, num3);
372 {
373 if (num3 == 16)
374 {
376 }
377 }
378 else if (SocketProtocolSupportPal.OSSupportsIPv6 && ptr2->ai_family ==
AddressFamily.InterNetworkV6 && num3 == 28)
379 {
381 }
382 }
383 hostName = (justAddresses ? null :
text);
385 }
static IPAddress CreateIPv6Address(ReadOnlySpan< byte > socketAddress)
static IPAddress CreateIPv4Address(ReadOnlySpan< byte > socketAddress)
static unsafe? string PtrToStringUni(IntPtr ptr)