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

◆ IsSupported() [3/3]

static bool System.Net.SocketProtocolSupportPal.IsSupported ( AddressFamily af)
inlinestaticprivate

Definition at line 35 of file SocketProtocolSupportPal.cs.

36 {
37 global::Interop.Winsock.EnsureInitialized();
38 IntPtr intPtr = (IntPtr)(-1);
39 IntPtr intPtr2 = intPtr;
40 try
41 {
42 intPtr2 = global::Interop.Winsock.WSASocketW(af, SocketType.Stream, 0, IntPtr.Zero, 0, 128);
43 return intPtr2 != intPtr || Marshal.GetLastWin32Error() != 10047;
44 }
45 finally
46 {
47 if (intPtr2 != intPtr)
48 {
49 global::Interop.Winsock.closesocket(intPtr2);
50 }
51 }
52 }

References System.Runtime.InteropServices.Marshal.GetLastWin32Error(), and System.IntPtr.Zero.