#include <WebSocket.h>
|
| WebSocket () |
virtual | ~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...
|
|
local | send ( local binaryMsg, local len) |
| Sends binary data to websocket server. More...
|
|
void | close () |
| Closes the connection to server. More...
|
|
State | getReadyState () |
| Gets current state of connection. More...
|
|
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
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/cocos2d/MyWork/cocos2d-x-develop/cocos/network/WebSocket.h