|
Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
|
Public Member Functions | |
| WebSocket (HttpServerConnection *conn) | |
| Object class constructor. More... | |
| virtual | ~WebSocket () |
| Virtual object class destructor. More... | |
| virtual void | send (const char *message, int length, wsFrameType type=WS_TEXT_FRAME) |
| Send data to other peer. More... | |
| void | sendString (const String &message) |
| Send a string to other peer. More... | |
| void | sendBinary (const uint8_t *data, int size) |
| Send binary data to other peer. More... | |
| void | enableCommand () |
| Enable command processing. More... | |
| void | close () |
| Close webSocket connection. More... | |
| void | setTimeOut (uint16_t waitTimeOut) |
| Set TCP connection timeout. More... | |
| bool | operator== (const WebSocket &other) const |
| Test if two sockets are the same. More... | |
| void | setUserData (void *userData) |
| Store user data pointer for this socket(connection) More... | |
| void * | getUserData () |
| Get user data pointer for this socket(connection) More... | |
Protected Member Functions | |
| bool | initialize (HttpRequest &request, HttpResponse &response) |
| bool | is (HttpServerConnection *conn) |
Friends | |
| class | HttpServer |
| WebSocket::WebSocket | ( | HttpServerConnection * | conn | ) |
Object class constructor.
| conn | Pointer to HttpServer connection object that this webSocket will use |
|
virtual |
Virtual object class destructor.
| void WebSocket::close | ( | ) |
Close webSocket connection.
| void WebSocket::enableCommand | ( | ) |
Enable command processing.
| void* WebSocket::getUserData | ( | ) |
Get user data pointer for this socket(connection)
|
inline |
Test if two sockets are the same.
| other | The other webSocket |
|
virtual |
Send data to other peer.
| message | Pointer to buffer to send |
| length | Length of buffer to send |
| type | Frametype of the message to be sent. Default is text frame. |
| void WebSocket::sendBinary | ( | const uint8_t * | data, |
| int | size | ||
| ) |
Send binary data to other peer.
| data | Pointer to buffer to send |
| size | Length of buffer to send |
| void WebSocket::sendString | ( | const String & | message | ) |
Send a string to other peer.
| message | String object holding the message to send |
|
inline |
Set TCP connection timeout.
| waitTimeOut | TCP timeout |
| void WebSocket::setUserData | ( | void * | userData | ) |
Store user data pointer for this socket(connection)
| userData | Pointer to user defined data |