#include <Lua_web_socket.h>
|
virtual | ~LuaWebSocket () |
virtual void | onOpen (WebSocket *ws) override |
virtual void | onMessage (WebSocket *ws, const WebSocket::Data &data) override |
local | onMessage ( local ws, local data) |
virtual void | onClose (WebSocket *ws) override |
virtual void | onError (WebSocket *ws, const WebSocket::ErrorCode &error) override |
local | onError ( local ws, local error) |
| 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...
|
|
var | send ( var binaryMsg, var 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...
|
|
local | close () |
| Closes the connection to server. More...
|
|
State | getReadyState () |
| Gets current state of connection. More...
|
|
virtual | ~Delegate () |
local | ~Delegate () |
virtual void | onOpen (WebSocket *ws)=0 |
virtual void | onMessage (WebSocket *ws, const Data &data)=0 |
virtual void | onClose (WebSocket *ws)=0 |
virtual void | onError (WebSocket *ws, const ErrorCode &error)=0 |
local | onError ( local ws, local error) |
Enumerator |
---|
kWebSocketScriptHandlerOpen |
|
kWebSocketScriptHandlerMessage |
|
kWebSocketScriptHandlerClose |
|
kWebSocketScriptHandlerError |
|
Enumerator |
---|
kWebSocketScriptHandlerOpen |
|
kWebSocketScriptHandlerMessage |
|
kWebSocketScriptHandlerClose |
|
kWebSocketScriptHandlerError |
|
Enumerator |
---|
kWebSocketScriptHandlerOpen |
|
kWebSocketScriptHandlerMessage |
|
kWebSocketScriptHandlerClose |
|
kWebSocketScriptHandlerError |
|
local onClose |
( |
local |
ws) | |
|
|
overridevirtual |
virtual void onError |
( |
WebSocket * |
ws, |
|
|
const WebSocket::ErrorCode & |
error |
|
) |
| |
|
overridevirtual |
var onError |
( |
var |
ws, |
|
|
var |
error |
|
) |
| |
|
overridevirtual |
local onError |
( |
local |
ws, |
|
|
local |
error |
|
) |
| |
|
overridevirtual |
virtual void onMessage |
( |
WebSocket * |
ws, |
|
|
const WebSocket::Data & |
data |
|
) |
| |
|
overridevirtual |
var onMessage |
( |
var |
ws, |
|
|
var |
data |
|
) |
| |
|
overridevirtual |
local onMessage |
( |
local |
ws, |
|
|
local |
data |
|
) |
| |
|
overridevirtual |
The documentation for this class was generated from the following file:
- /Users/cocos2d/MyWork/cocos2d-x-develop/cocos/scripting/lua-bindings/manual/Lua_web_socket.h