EHS Embedded HTTP Server  1.5.0.132
wsendpoint Class Reference

This class implements a server-side WebSockets endpoint. More...

#include <wsendpoint.h>

List of all members.

Public Member Functions

 wsendpoint (wshandler *h)
 Constructor.
void AddRxData (std::string data)
 Processes incoming data from the client.
void send (const std::string &payload, frame::opcode::value op)
 Send a data message.

Detailed Description

This class implements a server-side WebSockets endpoint.

Examples:

ehs_wsgate.cpp.


Constructor & Destructor Documentation

wsendpoint ( wshandler h) [inline]

Constructor.

Parameters:
hThe corresponding wshandler instance.

Definition at line 138 of file wsendpoint.h.


Member Function Documentation

void AddRxData ( std::string  data) [inline]

Processes incoming data from the client.

The incoming data is decoded, according to RFC6455. If any message is completely assembled, the on_message method of the corresponding wshandler is invoked. For internal replys (e.g. PONG responses) the do_response method of the corresponding wshandler is used. All other on_xxx methods are called when the corresponding events occur.

Parameters:
datathe raw data, received from the client.

Definition at line 170 of file wsendpoint.h.

References parser::consume(), parser::ready(), parser::is_control(), parser::reset(), wserror::code(), and wserror::what().

+ Here is the call graph for this function:

void send ( const std::string &  payload,
frame::opcode::value  op 
) [inline]

Send a data message.

This method is invoked from the corresponding wshandler in order to send TEXT and BINARY payloads.

Parameters:
payloadThe payload data.
opThe opcode according to RFC6455

Definition at line 229 of file wsendpoint.h.

References parser::set_opcode(), parser::set_fin(), parser::set_masked(), parser::set_payload(), parser::get_header_str(), and parser::get_payload_str().

+ Here is the call graph for this function:


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