18 #ifndef _SMING_CORE_NETWORK_WEBSOCKET_CLIENT_H_ 19 #define _SMING_CORE_NETWORK_WEBSOCKET_CLIENT_H_ 21 #include "Http/HttpClientConnection.h" 22 #include "Http/Websocket/WebsocketConnection.h" 54 bool connect(
const Url& url, uint32_t sslOptions = 0);
68 debug_d(
"Sending PING");
79 debug_d(
"Sending PONG");
Class to manage URL instance.
Definition: Url.h:66
Definition: WebsocketConnection.h:61
virtual void send(const char *message, size_t length, ws_frame_type_t type=WS_FRAME_TEXT)
Sends a websocket message from a buffer.
void sendString(const String &message)
Sends a string websocket message.
Definition: WebsocketConnection.h:126
void disconnect() SMING_DEPRECATED
Disconnects websocket client from server.
Definition: WebsocketClient.h:89
The string class.
Definition: WString.h:104
void sendBinary(const uint8_t *data, size_t length)
Sends a binary websocket message.
Definition: WebsocketConnection.h:136
void sendPing(const String &payload=nullptr)
Send websocket ping to server.
Definition: WebsocketClient.h:66
void setBinaryHandler(WebsocketBinaryDelegate handler)
Sets the callback handler to be called after a binary websocket message is received.
Definition: WebsocketConnection.h:210
void sendPong(const String &payload=nullptr)
Send websocket ping to server.
Definition: WebsocketClient.h:77
WsConnectionState getState()
Gets the state of the websocket connection.
Definition: WebsocketConnection.h:259
void setConnectionHandler(WebsocketDelegate handler)
Sets the callback handler to be called after successful websocket connection.
Definition: WebsocketConnection.h:192
void setDisconnectionHandler(WebsocketDelegate handler)
Sets the callback handler to be called before closing a websocket connection.
Definition: WebsocketConnection.h:219
Definition: HttpConnection.h:29
bool connect(const Url &url, uint32_t sslOptions=0)
Connects websocket client to server.
void close()
Closes a websocket connection (without closing the underlying http connection.
Definition: HttpClientConnection.h:28
Websocket Client.
Definition: WebsocketClient.h:32
Definition: HttpResponse.h:24
void setMessageHandler(WebsocketMessageDelegate handler)
Sets the callback handler to be called after a websocket message is received.
Definition: WebsocketConnection.h:201
WebsocketConnection(HttpConnection *connection, bool isClientConnection=true)
Constructs a websocket connection on top of http client or server connection.