EHS Embedded HTTP Server  1.5.1.173
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.

Definition at line 127 of file wsendpoint.h.


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 wserror::code(), parser< rng_policy >::consume(), parser< rng_policy >::is_control(), parser< rng_policy >::ready(), parser< rng_policy >::reset(), 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< 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:
 All Classes Functions Variables Enumerations