FreeRDP-WebConnect WebSockets gateway  1.0.0.167
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
wsgate::MyRawSocketHandler Class Reference

This class is our specialization of RawSocketHandler which handles all WebSocket I/O events. More...

#include <myrawsocket.hpp>

+ Inheritance diagram for wsgate::MyRawSocketHandler:
+ Collaboration diagram for wsgate::MyRawSocketHandler:

List of all members.

Public Member Functions

 MyRawSocketHandler (WsGate *parent)
 Constructor.
virtual bool OnData (EHSConnection *conn, std::string data)
 Handle raw data.
virtual void OnConnect (EHSConnection *conn)
 Handle connect event.
virtual void OnDisconnect (EHSConnection *conn)
 Handle disconnect event.
bool Prepare (EHSConnection *conn, const std::string host, const std::string user, const std::string pass, const WsRdpParams &params)
 Creates an RDP session and instantiates the relevant handler classes.
void OnMessage (EHSConnection *conn, const std::string &data)
 Event handler for WebSocket message events.

Detailed Description

This class is our specialization of RawSocketHandler which handles all WebSocket I/O events.

Definition at line 45 of file myrawsocket.hpp.


Constructor & Destructor Documentation

wsgate::MyRawSocketHandler::MyRawSocketHandler ( WsGate *  parent)

Constructor.

Parameters:
parentThe corresponding WsGate instance which creted this instance.

Member Function Documentation

virtual void wsgate::MyRawSocketHandler::OnConnect ( EHSConnection conn)
virtual

Handle connect event.

Called by EHS, if an EHSConnection has switched into raw mode.

See also:
RawSocketHandler::OnConnect
Parameters:
connThe EHSConnection on which the event happened.

Implements RawSocketHandler.

virtual bool wsgate::MyRawSocketHandler::OnData ( EHSConnection conn,
std::string  data 
)
virtual

Handle raw data.

Called by EHS, if an EHSConnection is in raw mode.

See also:
RawSocketHandler::OnData
Parameters:
connThe EHSConnection on which the data was received.
dataThe received data.
Returns:
true, if the connection should be kept open.

Implements RawSocketHandler.

virtual void wsgate::MyRawSocketHandler::OnDisconnect ( EHSConnection conn)
virtual

Handle disconnect event.

Called by EHS, if an EHSConnection is about to be closed.

See also:
RawSocketHandler::OnDisconnect
Parameters:
connThe EHSConnection on which the event happened.

Implements RawSocketHandler.

void wsgate::MyRawSocketHandler::OnMessage ( EHSConnection conn,
const std::string &  data 
)

Event handler for WebSocket message events.

Gets invoked from the WebSockets codec whenever a message is received from the client.

Parameters:
connThe EHSConnection which received this message.
dataThe payload of the message.
bool wsgate::MyRawSocketHandler::Prepare ( EHSConnection conn,
const std::string  host,
const std::string  user,
const std::string  pass,
const WsRdpParams params 
)

Creates an RDP session and instantiates the relevant handler classes.

Parameters:
connThe EHSConnection which triggered thsi action.
hostThe RDP host to connect to
userThe user name to be used for the RDP session.
passThe password to be used for the RDP session.
paramsAdditional RDP parameters.
Returns:
true on success.

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