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

This class implements websockets. It grabs the network context from C::Webserver and utilizes it directly as a tcp streaming service More...

Inheritance diagram for OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler:
Inheritance graph
[legend]
Collaboration diagram for OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler:
Collaboration graph
[legend]

Public Member Functions

 WebSocketHttpServerHandler (OSHttpRequest preq, IHttpClientContext pContext, int bufferlen)
 
void SetChunksize (int pChunk)
 Sets the length of the stream buffer More...
 
void Start ()
 This triggers the websocket to start the upgrade process... This is a Generalized Networking 'common sense' helper method. Some people expect to call Start() instead of the more context appropriate HandshakeAndUpgrade() More...
 
void HandshakeAndUpgrade ()
 This triggers the websocket start the upgrade process More...
 
IPEndPoint GetRemoteIPEndpoint ()
 
void SendMessage (string message)
 Sends a string to the other side More...
 
void SendData (byte[] data)
 
void SendPingCheck ()
 Sends a Ping check to the other side. The other side SHOULD respond as soon as possible with a pong frame. This interleaves with incoming fragmented frames. More...
 
void Close (string message)
 Closes the websocket connection. Sends a close message to the other side if it hasn't already done so. More...
 
void Dispose ()
 
- Public Member Functions inherited from OpenSim.Framework.Servers.HttpServer.BaseRequestHandler
string GetParam (string path)
 
string[] SplitParams (string path)
 

Public Attributes

ValidateHandshake HandshakeValidateMethodOverride = null
 Set this delegate to allow your module to validate the origin of the Websocket request. Primary line of defense against cross site scripting More...
 

Properties

bool NoDelay_TCP_Nagle [get, set]
 This is the famous nagle. More...
 
int MaxPayloadSize [get, set]
 Max Payload Size in bytes. Defaults to 40MB, but could be set upon connection before calling handshake and upgrade. More...
 
int InitialMsgTimeout [get, set]
 Set this to the maximum amount of milliseconds to wait for the first complete message to be sent or received on the websocket after upgrading Default, it waits forever. Use this when your Websocket consuming code opens a connection and waits for a message from the other side to avoid a Denial of Service vector. More...
 
- Properties inherited from OpenSim.Framework.Servers.HttpServer.BaseRequestHandler
int RequestsReceived [get, set]
 
int RequestsHandled [get, set]
 
virtual string ContentType [get]
 
virtual string HttpMethod [get]
 
string Name [get, set]
 
string Description [get, set]
 
virtual string Path [get]
 

Events

DataDelegate OnData
 Binary Data will trigger this event More...
 
TextDelegate OnText
 Textual Data will trigger this event More...
 
PingDelegate OnPing
 A ping request form the other side will trigger this event. This class responds to the ping automatically. You shouldn't send a pong. it's informational. More...
 
PongDelegate OnPong
 This is a response to a ping you sent. More...
 
UpgradeCompletedDelegate OnUpgradeCompleted
 This is a regular HTTP Request... This may be removed in the future. More...
 
UpgradeFailedDelegate OnUpgradeFailed
 If the upgrade failed, this will be fired More...
 
CloseDelegate OnClose
 When the websocket is closed, this will be fired. More...
 

Additional Inherited Members

- Protected Member Functions inherited from OpenSim.Framework.Servers.HttpServer.BaseRequestHandler
 BaseRequestHandler (string httpMethod, string path)
 
 BaseRequestHandler (string httpMethod, string path, string name, string description)
 
bool CheckParam (string path)
 

Detailed Description

This class implements websockets. It grabs the network context from C::Webserver and utilizes it directly as a tcp streaming service

Definition at line 43 of file WebsocketServerHandler.cs.

Constructor & Destructor Documentation

OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler.WebSocketHttpServerHandler ( OSHttpRequest  preq,
IHttpClientContext  pContext,
int  bufferlen 
)
inline

Definition at line 135 of file WebsocketServerHandler.cs.

Member Function Documentation

void OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler.Close ( string  message)
inline

Closes the websocket connection. Sends a close message to the other side if it hasn't already done so.

Parameters
message

Definition at line 594 of file WebsocketServerHandler.cs.

Here is the call graph for this function:

void OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler.Dispose ( )
inline

Definition at line 755 of file WebsocketServerHandler.cs.

IPEndPoint OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler.GetRemoteIPEndpoint ( )
inline

Definition at line 279 of file WebsocketServerHandler.cs.

void OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler.HandshakeAndUpgrade ( )
inline

This triggers the websocket start the upgrade process

Definition at line 228 of file WebsocketServerHandler.cs.

void OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler.SendData ( byte[]  data)
inline

Definition at line 539 of file WebsocketServerHandler.cs.

Here is the call graph for this function:

void OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler.SendMessage ( string  message)
inline

Sends a string to the other side

Parameters
messagethe string message that is to be sent

Definition at line 524 of file WebsocketServerHandler.cs.

void OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler.SendPingCheck ( )
inline

Sends a Ping check to the other side. The other side SHOULD respond as soon as possible with a pong frame. This interleaves with incoming fragmented frames.

Definition at line 576 of file WebsocketServerHandler.cs.

Here is the call graph for this function:

void OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler.SetChunksize ( int  pChunk)
inline

Sets the length of the stream buffer

Parameters
pChunkByte length.

Definition at line 157 of file WebsocketServerHandler.cs.

void OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler.Start ( )
inline

This triggers the websocket to start the upgrade process... This is a Generalized Networking 'common sense' helper method. Some people expect to call Start() instead of the more context appropriate HandshakeAndUpgrade()

Definition at line 201 of file WebsocketServerHandler.cs.

Member Data Documentation

ValidateHandshake OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler.HandshakeValidateMethodOverride = null

Set this delegate to allow your module to validate the origin of the Websocket request. Primary line of defense against cross site scripting

Definition at line 101 of file WebsocketServerHandler.cs.

Property Documentation

int OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler.InitialMsgTimeout
getset

Set this to the maximum amount of milliseconds to wait for the first complete message to be sent or received on the websocket after upgrading Default, it waits forever. Use this when your Websocket consuming code opens a connection and waits for a message from the other side to avoid a Denial of Service vector.

Definition at line 220 of file WebsocketServerHandler.cs.

int OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler.MaxPayloadSize
getset

Max Payload Size in bytes. Defaults to 40MB, but could be set upon connection before calling handshake and upgrade.

Definition at line 210 of file WebsocketServerHandler.cs.

bool OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler.NoDelay_TCP_Nagle
getset

This is the famous nagle.

Definition at line 173 of file WebsocketServerHandler.cs.

Event Documentation

CloseDelegate OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler.OnClose

When the websocket is closed, this will be fired.

Definition at line 95 of file WebsocketServerHandler.cs.

DataDelegate OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler.OnData

Binary Data will trigger this event

Definition at line 58 of file WebsocketServerHandler.cs.

PingDelegate OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler.OnPing

A ping request form the other side will trigger this event. This class responds to the ping automatically. You shouldn't send a pong. it's informational.

Definition at line 70 of file WebsocketServerHandler.cs.

PongDelegate OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler.OnPong

This is a response to a ping you sent.

Definition at line 75 of file WebsocketServerHandler.cs.

TextDelegate OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler.OnText

Textual Data will trigger this event

Definition at line 63 of file WebsocketServerHandler.cs.

UpgradeCompletedDelegate OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler.OnUpgradeCompleted

This is a regular HTTP Request... This may be removed in the future.

When the upgrade from a HTTP request to a Websocket is completed, this will be fired

Definition at line 85 of file WebsocketServerHandler.cs.

UpgradeFailedDelegate OpenSim.Framework.Servers.HttpServer.WebSocketHttpServerHandler.OnUpgradeFailed

If the upgrade failed, this will be fired

Definition at line 90 of file WebsocketServerHandler.cs.


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