Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
|
Delegate callback type for connection of websocket client. More...
#include <WebsocketClient.h>
Public Member Functions | |
WebsocketClient (bool autoDestruct=false) | |
void | setWebSocketMessageHandler (WebSocketClientMessageDelegate handler) |
void | setWebSocketDisconnectedHandler (WebSocketClientDisconnectDelegate handler) |
Set handler for websocket text messages. More... | |
void | setWebSocketConnectedHandler (WebSocketClientConnectedDelegate handler) |
Set handler for websocket disconnection event. More... | |
void | setWebSocketBinaryHandler (WebSocketClientBinaryDelegate handler) |
Set handler for websocket connection event. More... | |
bool | connect (String url, uint32_t sslOptions=0) |
Set handler for websocket binary messages. More... | |
void | sendPing () |
Connects websocket client to server. More... | |
void | sendPong () |
Send websocket ping to server. More... | |
void | disconnect () |
Send websocket ping to server. More... | |
void | sendMessage (char *msg, uint16_t length) |
Disconnects websocket client from server. More... | |
void | sendMessage (String str) |
Send text message to websocket server. More... | |
void | sendBinary (uint8_t *msg, uint16_t length) |
Send text message to websocket server. More... | |
wsMode | getWSMode () |
Send binary message to websocket server. More... | |
Protected Member Functions | |
virtual void | onFinished (TcpClientState finishState) |
Get websocket client mode. More... | |
virtual void | onError (err_t err) |
virtual err_t | onReceive (pbuf *buf) |
bool | _verifyKey (char *buf, int size) |
void | _sendFrame (WSFrameType frameType, uint8_t *msg, uint16_t length) |
virtual bool | connect (String server, int port, boolean useSsl=false, uint32_t sslOptions=0) |
virtual bool | connect (IPAddress addr, uint16_t port, boolean useSsl=false, uint32_t sslOptions=0) |
virtual void | close () |
void | setReceiveDelegate (TcpClientDataDelegate receiveCb=NULL) |
Set or clear the callback for received data. More... | |
void | setCompleteDelegate (TcpClientCompleteDelegate completeCb=NULL) |
Set or clear the callback for connection close. More... | |
bool | send (const char *data, uint16_t len, bool forceCloseAfterSent=false) |
bool | sendString (String data, bool forceCloseAfterSent=false) |
__forceinline bool | isProcessing () |
__forceinline TcpClientState | getConnectionState () |
virtual err_t | onConnected (err_t err) |
virtual err_t | onSent (uint16_t len) |
virtual void | onReadyToSendData (TcpConnectionEvent sourceEvent) |
void | pushAsyncPart () |
int | writeString (const char *data, uint8_t apiflags=TCP_WRITE_FLAG_COPY) |
int | writeString (const String data, uint8_t apiflags=TCP_WRITE_FLAG_COPY) |
virtual int | write (const char *data, int len, uint8_t apiflags=TCP_WRITE_FLAG_COPY) |
int | write (IDataSourceStream *stream) |
__forceinline uint16_t | getAvailableWriteSize () |
void | flush () |
void | setTimeOut (uint16_t waitTimeOut) |
IPAddress | getRemoteIp () |
uint16_t | getRemotePort () |
bool | internalTcpConnect (IPAddress addr, uint16_t port) |
virtual err_t | onPoll () |
void | initialize (tcp_pcb *pcb) |
Protected Attributes | |
tcp_pcb * | tcp = NULL |
uint16_t | sleep |
uint16_t | timeOut |
bool | canSend |
bool | autoSelfDestruct |
boolean | useSsl = false |
Delegate callback type for connection of websocket client.
Websocket Client
|
inherited |
Set or clear the callback for connection close.
completeCb | callback delegate or NULL |
|
inherited |
Set or clear the callback for received data.
receiveCb | callback delegate or NULL |