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

◆ PinSendBuffer()

void System.Net.WebSockets.WebSocketBuffer.PinSendBuffer ( ArraySegment< byte > payload,
out bool bufferHasBeenPinned )
inlinepackage

Definition at line 151 of file WebSocketBuffer.cs.

152 {
153 bufferHasBeenPinned = false;
155 if (Interlocked.Exchange(ref _sendBufferState, 1) != 0)
156 {
157 throw new AccessViolationException();
158 }
159 _pinnedSendBuffer = payload;
161 bufferHasBeenPinned = true;
164 }
static void ValidateBuffer(byte[] buffer, int offset, int count)
static unsafe IntPtr UnsafeAddrOfPinnedArrayElement(Array arr, int index)
Definition Marshal.cs:775
static int Exchange(ref int location1, int value)
static GCHandle Alloc(object? value)
Definition GCHandle.cs:81

References System.Net.WebSockets.WebSocketBuffer._pinnedSendBuffer, System.Net.WebSockets.WebSocketBuffer._pinnedSendBufferEndAddress, System.Net.WebSockets.WebSocketBuffer._pinnedSendBufferHandle, System.Net.WebSockets.WebSocketBuffer._pinnedSendBufferStartAddress, System.Net.WebSockets.WebSocketBuffer._sendBufferState, System.Runtime.InteropServices.GCHandle.Alloc(), System.ArraySegment< T >.Array, System.ArraySegment< T >.Count, System.Threading.Interlocked.Exchange(), System.ArraySegment< T >.Offset, System.Runtime.InteropServices.Marshal.UnsafeAddrOfPinnedArrayElement(), and System.Net.WebSockets.WebSocketValidate.ValidateBuffer().

Referenced by System.Net.WebSockets.WebSocketBase.WebSocketOperation.SendOperation.CreateBuffer(), and System.Net.WebSockets.WebSocketBase.WebSocketOperation.CloseOutputOperation.CreateBuffer().