EHS Embedded HTTP Server  1.5.1.0
wsendpoint Class Reference

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

#include <wsendpoint.h>

Public Member Functions

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

Detailed Description

This class implements a server-side WebSockets endpoint.

Examples
ehs_wsgate.cpp.

Definition at line 127 of file wsendpoint.h.

Constructor & Destructor Documentation

◆ wsendpoint()

wsendpoint ( wshandler h)
inline

Constructor.

Parameters
hThe corresponding wshandler instance.

Definition at line 138 of file wsendpoint.h.

Member Function Documentation

◆ AddRxData()

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 wserror::code(), and wserror::what().

+ Here is the call graph for this function:

◆ send()

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< rng_policy >::get_header_str(), parser< rng_policy >::get_payload_str(), parser< rng_policy >::set_fin(), parser< rng_policy >::set_masked(), parser< rng_policy >::set_opcode(), and parser< rng_policy >::set_payload().

+ Here is the call graph for this function:

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