Class WebSocketFrameCommon
- Namespace
- Alis.Core.Network.Internal
- Assembly
- Alis.dll
The web socket frame common class
internal static class WebSocketFrameCommon
Inheritance
Inherited Members
Fields
MaskKeyLength
The mask key length
public const int MaskKeyLength = 4
Field Value
Methods
ApplyMaskKey(byte[], byte[], int, int, int)
Applies the mask key using the specified buffer
internal static void ApplyMaskKey(byte[] buffer, byte[] maskKeyArray, int payloadOffset, int payloadCountPlusOffset, int maskKeyOffset)
Parameters
buffer
byte[]-
The buffer
maskKeyArray
byte[]-
The mask key array
payloadOffset
int-
The payload offset
payloadCountPlusOffset
int-
The payload count plus offset
maskKeyOffset
int-
The mask key offset
ApplyMaskKeyAtIndex(byte[], byte[], int, int, int)
Applies the mask key at index using the specified buffer
internal static void ApplyMaskKeyAtIndex(byte[] buffer, byte[] maskKeyArray, int i, int payloadOffset, int maskKeyOffset)
Parameters
buffer
byte[]-
The buffer
maskKeyArray
byte[]-
The mask key array
i
int-
The
payloadOffset
int-
The payload offset
maskKeyOffset
int-
The mask key offset
ToggleMask(ArraySegment<byte>, ArraySegment<byte>)
Mutate payload with the mask key This is a reversible process If you apply this to masked data it will be unmasked and visa versa
public static void ToggleMask(ArraySegment<byte> maskKey, ArraySegment<byte> payload)
Parameters
maskKey
ArraySegment<byte>-
The 4 byte mask key
payload
ArraySegment<byte>-
The payload to mutate
ValidateMaskKey(ArraySegment<byte>)
Validates the mask key using the specified mask key
internal static void ValidateMaskKey(ArraySegment<byte> maskKey)
Parameters
maskKey
ArraySegment<byte>-
The mask key
Exceptions
- MaskKeyLengthException
-
MaskKey key must be {MaskKeyLength} bytes