Class WebsocketClient

Inheritance Relationships

Base Type

Class Documentation

class WebsocketClient : public O3DS::Websocket

Public Functions

WebsocketClient()
~WebsocketClient()
virtual bool start(const char *url) override

Starts the connector, often using nng_dial or nng_listen.

virtual void stop() override
virtual bool write(const char *data, size_t len) override

Write bytes - len is the size of data.

virtual size_t read(char *data, size_t len) override

Read bytes - len is the fixed size of buffer, returns the number of bytes read.

virtual size_t read(char **data, size_t *len) override

Read a message, realloc and rezie *data if needed. If the buffer is reszied, len will be updated. Returns the size of the message, which may be less than the buffer size

void onMessage(websocketpp::connection_hdl hdl, client_message_ptr msg)
void onClose(websocketpp::connection_hdl hdl)
void onFail(websocketpp::connection_hdl hdl)
bool connect()

Public Members

client mClient
std::string mUrl