OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Types | Static Public Member Functions | List of all members
OpenSim.Framework.Servers.HttpServer.WebSocketReader Class Reference

Reads a byte stream and returns Websocket frames. More...

Public Types

enum  OpCode {
  OpCode.Continue = 0x0, OpCode.Text = 0x1, OpCode.Binary = 0x2, OpCode.Close = 0x8,
  OpCode.Ping = 0x9, OpCode.Pong = 0xA
}
 These are the Frame Opcodes More...
 

Static Public Member Functions

static void Mask (int pMask, byte[] pBuffer)
 Masks and Unmasks data using the frame mask. Mask is applied per octal Note: Frames from clients MUST be masked Note: Frames from servers MUST NOT be masked More...
 
static bool TryReadHeader (byte[] pBuffer, int pOffset, int length, out WebsocketFrameHeader oHeader, out int moveBuffer)
 Attempts to read a header off the provided buffer. Returns true, exports a WebSocketFrameheader, and an int to move the buffer forward when it reads a header. False when it can't read a header More...
 

Detailed Description

Reads a byte stream and returns Websocket frames.

Definition at line 789 of file WebsocketServerHandler.cs.

Member Enumeration Documentation

These are the Frame Opcodes

Enumerator
Continue 
Text 
Binary 
Close 
Ping 
Pong 

Definition at line 799 of file WebsocketServerHandler.cs.

Member Function Documentation

static void OpenSim.Framework.Servers.HttpServer.WebSocketReader.Mask ( int  pMask,
byte[]  pBuffer 
)
inlinestatic

Masks and Unmasks data using the frame mask. Mask is applied per octal Note: Frames from clients MUST be masked Note: Frames from servers MUST NOT be masked

Parameters
pMaskInt representing 32 bytes of mask data. Mask is applied per octal
pBuffer

Definition at line 819 of file WebsocketServerHandler.cs.

static bool OpenSim.Framework.Servers.HttpServer.WebSocketReader.TryReadHeader ( byte[]  pBuffer,
int  pOffset,
int  length,
out WebsocketFrameHeader  oHeader,
out int  moveBuffer 
)
inlinestatic

Attempts to read a header off the provided buffer. Returns true, exports a WebSocketFrameheader, and an int to move the buffer forward when it reads a header. False when it can't read a header

Parameters
pBufferBytes read from the stream
pOffsetStarting place in the stream to begin trying to read from
lengthLenth in the stream to try and read from. Provided for cases where the buffer's length is larger then the data in it
oHeaderOutputs the read WebSocket frame header
moveBufferInforms the calling stream to move the buffer forward
Returns
True if it got a header, False if it didn't get a header

Definition at line 850 of file WebsocketServerHandler.cs.


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