EHS Embedded HTTP Server
1.5.0.132
|
Helper class for performing raw socket IO. More...
#include <ehs.h>
Public Member Functions | |
virtual bool | OnData (EHSConnection *conn, std::string data)=0 |
Handle raw data. | |
virtual void | OnConnect (EHSConnection *conn)=0 |
Handle connect event. | |
virtual void | OnDisconnect (EHSConnection *conn)=0 |
Handle disconnect event. |
Helper class for performing raw socket IO.
This class abstracts an interface to an external helper which which facilitates binary IO on a connection (for implementing WebSockets). In order to use raw IO, one first has to register an instance of this class using SetRawSocketHandler() and then produce a HttpResponse code 101. After sending this HttpResponse, EHS switches the corresponding connection into raw Mode, which does no further message parsing on received data, but invokes the OnData method whenever data arrives from the client.
virtual void OnConnect | ( | EHSConnection * | conn | ) | [pure virtual] |
Handle connect event.
Called by EHS, if an EHSConnection has switched into raw mode.
conn | The EHSConnection on which the event has happened. |
virtual bool OnData | ( | EHSConnection * | conn, |
std::string | data | ||
) | [pure virtual] |
Handle raw data.
Called by EHS, if an EHSConnection is in raw mode.
conn | The EHSConnection on which the data was received. |
data | The received data. |
virtual void OnDisconnect | ( | EHSConnection * | conn | ) | [pure virtual] |
Handle disconnect event.
Called by EHS, if an EHSConnection is about to be closed.
conn | The EHSConnection on which the event has happened. |