MTSC  1.0.5
Build TCP servers out of modules with handlers for communication, exception and logging.
MTSC.Common.WebSockets.WebsocketMessage Class Reference

Class containing the bytes of a websocket received message. More...

Public Types

enum  Opcodes {
  Text = 1, Binary = 2, Close = 8, Ping = 9,
  Pong = 10
}
 

Public Member Functions

 WebsocketMessage (byte[] messageBytes)
 Creates a new instance of websocket message containing the given message. More...
 
 WebsocketMessage ()
 Creates a new instance of websocket message. More...
 
byte [] GetMessageBytes ()
 Get the packed message bytes. More...
 

Properties

bool? FIN [get, set]
 FIN bit. More...
 
Opcodes Opcode [get, set]
 Frame Opcode More...
 
bool? Masked [get, set]
 Mask bit. More...
 
ulong MessageLength [get, set]
 Length of message. More...
 
byte [] Mask [get, set]
 Mask of the message. More...
 
byte [] Data [get, set]
 Data of the message. More...
 

Detailed Description

Class containing the bytes of a websocket received message.

Definition at line 11 of file WebsocketMessage.cs.

Constructor & Destructor Documentation

◆ WebsocketMessage() [1/2]

MTSC.Common.WebSockets.WebsocketMessage.WebsocketMessage ( byte []  messageBytes)

Creates a new instance of websocket message containing the given message.

Parameters
messageBytesByte array containing the message bytes.

Definition at line 133 of file WebsocketMessage.cs.

◆ WebsocketMessage() [2/2]

MTSC.Common.WebSockets.WebsocketMessage.WebsocketMessage ( )

Creates a new instance of websocket message.

Definition at line 180 of file WebsocketMessage.cs.

Member Function Documentation

◆ GetMessageBytes()

byte [] MTSC.Common.WebSockets.WebsocketMessage.GetMessageBytes ( )

Get the packed message bytes.

Returns
An array containing the message.

Definition at line 191 of file WebsocketMessage.cs.

Property Documentation

◆ Data

byte [] MTSC.Common.WebSockets.WebsocketMessage.Data
getset

Data of the message.

Definition at line 120 of file WebsocketMessage.cs.

◆ FIN

bool? MTSC.Common.WebSockets.WebsocketMessage.FIN
getset

FIN bit.

Definition at line 28 of file WebsocketMessage.cs.

◆ Mask

byte [] MTSC.Common.WebSockets.WebsocketMessage.Mask
getset

Mask of the message.

Definition at line 115 of file WebsocketMessage.cs.

◆ Masked

bool? MTSC.Common.WebSockets.WebsocketMessage.Masked
getset

Mask bit.

Definition at line 38 of file WebsocketMessage.cs.

◆ MessageLength

ulong MTSC.Common.WebSockets.WebsocketMessage.MessageLength
getset

Length of message.

Definition at line 43 of file WebsocketMessage.cs.

◆ Opcode

Opcodes MTSC.Common.WebSockets.WebsocketMessage.Opcode
getset

Frame Opcode

Gets and sets the 4 lower bits of the first byte.

Definition at line 33 of file WebsocketMessage.cs.


The documentation for this class was generated from the following file: