#include <WebSocket.h>
Errors in websocket.
| Enumerator |
|---|
| TIME_OUT |
|
| CONNECTION_FAILURE |
|
| UNKNOWN |
|
Errors in websocket.
| Enumerator |
|---|
| TIME_OUT |
|
| CONNECTION_FAILURE |
|
| UNKNOWN |
|
Errors in websocket.
| Enumerator |
|---|
| TIME_OUT |
|
| CONNECTION_FAILURE |
|
| UNKNOWN |
|
Websocket state.
| Enumerator |
|---|
| CONNECTING |
|
| OPEN |
|
| CLOSING |
|
| CLOSED |
|
Websocket state.
| Enumerator |
|---|
| CONNECTING |
|
| OPEN |
|
| CLOSING |
|
| CLOSED |
|
Websocket state.
| Enumerator |
|---|
| CONNECTING |
|
| OPEN |
|
| CLOSING |
|
| CLOSED |
|
Closes the connection to server.
Closes the connection to server.
Closes the connection to server.
Gets current state of connection.
Gets current state of connection.
Gets current state of connection.
| 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
| local init |
( |
local |
delegate, |
|
|
local |
url, |
|
|
local |
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.
Sends string data to websocket server.
| local send |
( |
local |
message | ) |
|
Sends string data to websocket server.
| void send |
( |
const unsigned char * |
binaryMsg, |
|
|
unsigned int |
len |
|
) |
| |
Sends binary data to websocket server.
| var send |
( |
var |
binaryMsg, |
|
|
var |
len |
|
) |
| |
Sends binary data to websocket server.
| local send |
( |
local |
binaryMsg, |
|
|
local |
len |
|
) |
| |
Sends binary data to websocket server.
friend class
WebSocketCallbackWrapper |
|
friend |
| var WebSocketCallbackWrapper |
|
friend |
| local WebSocketCallbackWrapper |
|
friend |
| friend class WsThreadHelper |
|
friend |
The documentation for this class was generated from the following file:
- /Users/huabingxu/work/cocos2d-x/cocos/network/WebSocket.h