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

◆ CreateDelegate< T >()

static unsafe T System.Net.Sockets.DynamicWinsockMethods.CreateDelegate< T > ( [NotNull] ref T cache,
SafeSocketHandle socketHandle,
string guidString )
inlinestaticprivate
Type Constraints
T :Delegate 

Definition at line 56 of file DynamicWinsockMethods.cs.

56 : Delegate
57 {
58 Guid guid = new Guid(guidString);
59 IntPtr funcPtr = IntPtr.Zero;
60 if (global::Interop.Winsock.WSAIoctl(socketHandle, -939524090, ref guid, sizeof(Guid), out funcPtr, sizeof(IntPtr), out var _, IntPtr.Zero, IntPtr.Zero) != 0)
61 {
62 throw new SocketException();
63 }
65 return cache;
66 }
static Delegate GetDelegateForFunctionPointer(IntPtr ptr, Type t)
Definition Marshal.cs:1414
static int CompareExchange(ref int location1, int value, int comparand)

References System.Threading.Interlocked.CompareExchange(), System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer(), and System.IntPtr.Zero.