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

◆ Allocate()

unsafe global.Interop.HttpApi.HTTP_REQUEST * System.Net.AsyncRequestContext.Allocate ( ThreadPoolBoundHandle boundHandle,
uint size )
inlineprivate

Definition at line 21 of file AsyncRequestContext.cs.

22 {
23 uint num = ((size != 0) ? size : ((base.RequestBuffer == IntPtr.Zero) ? 4096u : base.Size));
24 if (_nativeOverlapped != null)
25 {
26 NativeOverlapped* nativeOverlapped = _nativeOverlapped;
27 _nativeOverlapped = null;
28 _boundHandle.FreeNativeOverlapped(nativeOverlapped);
29 }
30 SetBuffer(checked((int)num));
31 _boundHandle = boundHandle;
32 _nativeOverlapped = boundHandle.AllocateNativeOverlapped(ListenerAsyncResult.IOCallback, _result, base.RequestBuffer);
33 return (global::Interop.HttpApi.HTTP_REQUEST*)base.RequestBuffer.ToPointer();
34 }
readonly ListenerAsyncResult _result
ThreadPoolBoundHandle _boundHandle
unsafe NativeOverlapped * _nativeOverlapped
unsafe void SetBuffer(int size)
unsafe void FreeNativeOverlapped(NativeOverlapped *overlapped)
unsafe NativeOverlapped * AllocateNativeOverlapped(IOCompletionCallback callback, object? state, object? pinData)

References System.Net.AsyncRequestContext._boundHandle, System.Net.AsyncRequestContext._nativeOverlapped, System.Net.AsyncRequestContext._result, System.Threading.ThreadPoolBoundHandle.AllocateNativeOverlapped(), System.Threading.ThreadPoolBoundHandle.FreeNativeOverlapped(), System.Net.ListenerAsyncResult.IOCallback, System.Net.RequestContextBase.SetBuffer(), and System.IntPtr.Zero.

Referenced by System.Net.AsyncRequestContext.AsyncRequestContext(), and System.Net.AsyncRequestContext.Reset().