87 return new WebSocketBuffer(internalBuffer, receiveBufferSize, nativeSendBufferSize);
115 int num = (useZeroMaskingKey ? 4 : 3);
116 global::Interop.WebSocket.Property[]
array =
new global::Interop.WebSocket.Property[num];
118 array[0] =
new global::Interop.WebSocket.Property
125 array[1] =
new global::Interop.WebSocket.Property
132 array[2] =
new global::Interop.WebSocket.Property
139 if (useZeroMaskingKey)
141 array[3] =
new global::Interop.WebSocket.Property
153 bufferHasBeenPinned =
false;
161 bufferHasBeenPinned =
true;
211 long num = bufferData.ToInt64();
212 long num2 = num + bufferLength;
236 int count = payload.Count - unconsumedDataOffset;
245 _bufferedPayloadReceiveResult.Count -= num;
295 if (dataBufferCount > dataBuffers.Length)
299 int num = dataBuffers.Length;
303 num = (int)dataBufferCount;
306 for (
int i = 0; i < num; i++)
308 global::Interop.WebSocket.Buffer
buffer = dataBuffers[i];
334 return sendBufferSize;
346 bufferData =
buffer.CloseStatus.ReasonData;
347 bufferLength =
buffer.CloseStatus.ReasonLength;
356 bufferData =
buffer.Data.BufferData;
357 bufferLength =
buffer.Data.BufferLength;
403 long num2 = bufferSize + num;
426 internal static void Validate(
int count,
int receiveBufferSize,
int sendBufferSize,
bool isServerBuffer)
429 if (
count < internalBufferSize)
static void BlockCopy(Array src, int srcOffset, Array dst, int dstOffset, int count)
static byte Min(byte val1, byte val2)
static byte Max(byte val1, byte val2)
PayloadReceiveResult(int count, WebSocketMessageType messageType, bool endOfMessage)
WebSocketMessageType MessageType
void ValidateNativeBuffers(WebSocketProtocolComponent.Action action, WebSocketProtocolComponent.BufferType bufferType, global::Interop.WebSocket.Buffer[] dataBuffers, uint dataBufferCount)
bool ReceiveFromBufferedPayload(ArraySegment< byte > buffer, out WebSocketReceiveResult receiveResult)
static ArraySegment< byte > CreateInternalBufferArraySegment(int receiveBufferSize, int sendBufferSize, bool isServerBuffer)
static WebSocketBuffer CreateServerBuffer(ArraySegment< byte > internalBuffer, int receiveBufferSize)
bool IsPinnedSendPayloadBuffer(global::Interop.WebSocket.Buffer buffer, WebSocketProtocolComponent.BufferType bufferType)
volatile int _payloadOffset
ArraySegment< byte > _pinnedSendBuffer
ArraySegment< byte > ConvertPinnedSendPayloadFromNative(global::Interop.WebSocket.Buffer buffer, WebSocketProtocolComponent.BufferType bufferType)
readonly ArraySegment< byte > _propertyBuffer
void BufferPayload(ArraySegment< byte > payload, int unconsumedDataOffset, WebSocketMessageType messageType, bool endOfMessage)
WebSocketBuffer(ArraySegment< byte > internalBuffer, int receiveBufferSize, int sendBufferSize)
GCHandle _pinnedSendBufferHandle
readonly long _endAddress
readonly long _startAddress
bool IsInternalBuffer(byte[] buffer, int offset, int count)
bool IsPinnedSendPayloadBuffer(byte[] buffer, int offset, int count)
static int GetInternalBufferSize(int receiveBufferSize, int sendBufferSize, bool isServerBuffer)
long _pinnedSendBufferStartAddress
static void UnwrapWebSocketBuffer(global::Interop.WebSocket.Buffer buffer, WebSocketProtocolComponent.BufferType bufferType, out IntPtr bufferData, out uint bufferLength)
readonly int _receiveBufferSize
IntPtr ConvertPinnedSendPayloadToNative(byte[] buffer, int offset, int count)
readonly ArraySegment< byte > _internalBuffer
static void Validate(int count, int receiveBufferSize, int sendBufferSize, bool isServerBuffer)
global::Interop.WebSocket.Property[] CreateProperties(bool useZeroMaskingKey)
void ReleasePinnedSendBuffer()
static int GetNativeSendBufferSize(int sendBufferSize, bool isServerBuffer)
long _pinnedSendBufferEndAddress
void Dispose(WebSocketState webSocketState)
int GetOffset(IntPtr pBuffer)
void ConvertCloseBuffer(WebSocketProtocolComponent.Action action, global::Interop.WebSocket.Buffer buffer, out WebSocketCloseStatus closeStatus, out string reason)
static readonly int s_PropertyBufferSize
IntPtr ConvertPinnedSendPayloadToNative(ArraySegment< byte > payload)
readonly ArraySegment< byte > _nativeBuffer
void PinSendBuffer(ArraySegment< byte > payload, out bool bufferHasBeenPinned)
volatile PayloadReceiveResult _bufferedPayloadReceiveResult
IntPtr ToIntPtr(int offset)
bool IsNativeBuffer(IntPtr pBuffer, uint bufferSize)
readonly int _sendBufferSize
readonly ArraySegment< byte > _payloadBuffer
ArraySegment< byte > ConvertNativeBuffer(WebSocketProtocolComponent.Action action, global::Interop.WebSocket.Buffer buffer, WebSocketProtocolComponent.BufferType bufferType)
static void ValidateBuffer(byte[] buffer, int offset, int count)
static void WriteInt32(object ptr, int ofs, int val)
static unsafe IntPtr UnsafeAddrOfPinnedArrayElement(Array arr, int index)
static void WriteIntPtr(IntPtr ptr, int ofs, IntPtr val)
static string net_WebSockets_ArgumentOutOfRange_InternalBuffer
static string Format(string resourceFormat, object p1)
static string net_WebSockets_InvalidState_ClosedOrAborted
static int CompareExchange(ref int location1, int value, int comparand)
static int Exchange(ref int location1, int value)
static ArraySegment< T > Empty
static IntPtr Add(IntPtr pointer, int offset)
static readonly IntPtr Zero
unsafe IntPtr AddrOfPinnedObject()
static GCHandle Alloc(object? value)