WebSocket is wrapper of the libwebsockets-protocol, let the develop could call the websocket easily.
More...
|
|
| WebSocket () |
| | Construtor of WebSocket.
|
| |
|
| ctor () |
| | Construtor of WebSocket.
|
| |
|
| WebSocket () |
| | Construtor of WebSocket.
|
| |
|
virtual | ~WebSocket () |
| | Destructor of WebSocket.
|
| |
| bool | init (const Delegate &delegate, const std::string &url, const std::vector< std::string > *protocols=nullptr) |
| | The initialized method for websocket. More...
|
| |
| void | send (const std::string &message) |
| | Sends string data to websocket server. More...
|
| |
| void | send (const unsigned char *binaryMsg, unsigned int len) |
| | Sends binary data to websocket server. More...
|
| |
| var | send ( var binaryMsg, var len) |
| | Sends binary data to websocket server. More...
|
| |
| local | sendstring ( local binaryMsg, local len) |
| | Sends binary data to websocket server. More...
|
| |
|
void | close () |
| | Closes the connection to server.
|
| |
|
var | close () |
| | Closes the connection to server.
|
| |
|
local | close () |
| | Closes the connection to server.
|
| |
| State | getReadyState () |
| | Gets current state of connection. More...
|
| |
WebSocket is wrapper of the libwebsockets-protocol, let the develop could call the websocket easily.
| bool init |
( |
const Delegate & |
delegate, |
|
|
const std::string & |
url, |
|
|
const std::vector< std::string > * |
protocols = nullptr |
|
) |
| |
The initialized method for websocket.
It needs to be invoked right after websocket instance is allocated.
- Parameters
-
| delegate | The delegate which want to receive event from websocket. |
| url | The URL of websocket server. |
- Returns
- true: Success, false: Failure.
| var init |
( |
var |
delegate, |
|
|
var |
url, |
|
|
var |
protocols = nullptr |
|
) |
| |
The initialized method for websocket.
It needs to be invoked right after websocket instance is allocated.
- Parameters
-
| delegate | The delegate which want to receive event from websocket. |
| url | The URL of websocket server. |
- Returns
- true: Success, false: Failure.
| void send |
( |
const std::string & |
message | ) |
|
Sends string data to websocket server.
- Parameters
-
Sends string data to websocket server.
- Parameters
-
| local sendstring |
( |
local |
message | ) |
|
Sends string data to websocket server.
- Parameters
-
| void send |
( |
const unsigned char * |
binaryMsg, |
|
|
unsigned int |
len |
|
) |
| |
Sends binary data to websocket server.
- Parameters
-
| binaryMsg | binary string data. |
| len | the size of binary string data. |
| var send |
( |
var |
binaryMsg, |
|
|
var |
len |
|
) |
| |
Sends binary data to websocket server.
- Parameters
-
| binaryMsg | binary string data. |
| len | the size of binary string data. |
| local sendstring |
( |
local |
binaryMsg, |
|
|
local |
len |
|
) |
| |
Sends binary data to websocket server.
- Parameters
-
| binaryMsg | binary string data. |
| len | the size of binary string data. |
The documentation for this class was generated from the following file: