cocos2d-x
3.3
|
#include <Lua_web_socket.h>
Public Types | |
enum | WebSocketScriptHandlerType { kWebSocketScriptHandlerOpen, kWebSocketScriptHandlerMessage, kWebSocketScriptHandlerClose, kWebSocketScriptHandlerError } |
![]() | |
enum | ErrorCode { TIME_OUT, CONNECTION_FAILURE, UNKNOWN } |
Errors in websocket. More... | |
enum | State { CONNECTING, OPEN, CLOSING, CLOSED } |
Websocket state. More... | |
Public Member Functions | |
virtual | ~LuaWebSocket () |
virtual void | onOpen (WebSocket *ws) override |
virtual void | onMessage (WebSocket *ws, const WebSocket::Data &data) override |
virtual void | onClose (WebSocket *ws) override |
virtual void | onError (WebSocket *ws, const WebSocket::ErrorCode &error) override |
![]() | |
WebSocket () | |
ctor More... | |
virtual | ~WebSocket () |
NA NA More... | |
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... | |
void | close () |
Closes the connection to server. More... | |
State | getReadyState () |
Gets current state of connection. More... | |
![]() | |
virtual | ~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 |
|
virtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |