|
kmMqtt 0.0.1
MQTT Client Library
|
Interface for a WebSocket connection. More...
#include <IWebSocket.h>
Public Member Functions | |
| virtual bool | connect (const mqtt::Address &address) noexcept=0 |
| Connect to a WebSocket server. | |
| virtual int | send (const ByteBuffer &data) noexcept=0 |
| Send data over the WebSocket connection. | |
| virtual bool | close () noexcept=0 |
| Close the WebSocket connection. | |
| virtual void | tick () noexcept=0 |
| SDK calls this periodically in-case the WebSocket implementation needs to perform any tick tasks. | |
| virtual bool | isConnected () const noexcept=0 |
| Check if the WebSocket is connected. | |
| virtual int | getLastError () const noexcept=0 |
| Get the last error code. | |
| virtual int | getLastCloseCode () const noexcept=0 |
| Get the last close code and reason. | |
| virtual const char * | getLastCloseReason () const noexcept=0 |
| Get the last close reason. | |
| virtual void | setOnConnectCallback (OnConnectCallback callback) noexcept=0 |
| Set the callback for when the WebSocket connects. | |
| virtual void | setOnDisconnectCallback (OnDisconnectCallback callback) noexcept=0 |
| Set the callback for when the WebSocket disconnects. | |
| virtual void | setOnRecvdCallback (OnRecvdCallback callback) noexcept=0 |
| Set the callback for when data is received over the WebSocket. | |
| virtual void | setOnErrorCallback (OnErrorCallback callback) noexcept=0 |
| Set the callback for when an error occurs on the WebSocket. | |
Interface for a WebSocket connection.
|
pure virtualnoexcept |
Close the WebSocket connection.
Implemented in kmMqtt::DefaultWebsocket.
|
pure virtualnoexcept |
Connect to a WebSocket server.
| address | The address to connect to. |
Implemented in kmMqtt::DefaultWebsocket.
|
pure virtualnoexcept |
Get the last close code and reason.
Implemented in kmMqtt::DefaultWebsocket.
|
pure virtualnoexcept |
|
pure virtualnoexcept |
|
pure virtualnoexcept |
Check if the WebSocket is connected.
Implemented in kmMqtt::DefaultWebsocket.
|
pure virtualnoexcept |
Send data over the WebSocket connection.
Partial sends are managed internally by the SDK, socket implementation does not need to handle them.
| data | The data to send. Socket must manage its own partial sends. |
Implemented in kmMqtt::DefaultWebsocket.
|
pure virtualnoexcept |
Set the callback for when the WebSocket connects.
| callback | The callback function. |
Implemented in kmMqtt::DefaultWebsocket.
|
pure virtualnoexcept |
Set the callback for when the WebSocket disconnects.
| callback | The callback function. |
Implemented in kmMqtt::DefaultWebsocket.
|
pure virtualnoexcept |
Set the callback for when an error occurs on the WebSocket.
| callback | The callback function. |
Implemented in kmMqtt::DefaultWebsocket.
|
pure virtualnoexcept |
Set the callback for when data is received over the WebSocket.
| callback | The callback function. |
Implemented in kmMqtt::DefaultWebsocket.