cocos2d-x  3.0Beta0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
LuaWebSocket Class Reference

#include <Lua_web_socket.h>

Inheritance diagram for LuaWebSocket:
WebSocket WebSocket::Delegate

Public Types

enum  WebSocketScriptHandlerType { kWebSocketScriptHandlerOpen, kWebSocketScriptHandlerMessage, kWebSocketScriptHandlerClose, kWebSocketScriptHandlerError }
 
- Public Types inherited from WebSocket
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)
local onOpen ( local ws)
virtual void onMessage (WebSocket *ws, const WebSocket::Data &data)
local onMessage ( local ws, local data)
virtual void onClose (WebSocket *ws)
virtual void onError (WebSocket *ws, const WebSocket::ErrorCode &error)
local onError ( local ws, local error)
- Public Member Functions inherited from WebSocket
 WebSocket ()
virtual ~WebSocket ()
bool init (const Delegate &delegate, const std::string &url, const std::vector< std::string > *protocols=NULL)
 The initialized method for websocket. More...
 
local init ( local delegate, local url, local NULL)
 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...
 
- Public Member Functions inherited from WebSocket::Delegate
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

Member Enumeration Documentation

Enumerator
kWebSocketScriptHandlerOpen 
kWebSocketScriptHandlerMessage 
kWebSocketScriptHandlerClose 
kWebSocketScriptHandlerError 
Enumerator
kWebSocketScriptHandlerOpen 
kWebSocketScriptHandlerMessage 
kWebSocketScriptHandlerClose 
kWebSocketScriptHandlerError 
Enumerator
kWebSocketScriptHandlerOpen 
kWebSocketScriptHandlerMessage 
kWebSocketScriptHandlerClose 
kWebSocketScriptHandlerError 

Constructor & Destructor Documentation

virtual ~LuaWebSocket ( )
virtual
var ~LuaWebSocket ( )
virtual
local ~LuaWebSocket ( )
virtual

Member Function Documentation

virtual void onClose ( WebSocket ws)
virtual
var onClose ( var  ws)
virtual
local onClose ( local  ws)
virtual
virtual void onError ( WebSocket ws,
const WebSocket::ErrorCode &  error 
)
virtual
var onError ( var  ws,
var  error 
)
virtual
local onError ( local  ws,
local  error 
)
virtual
virtual void onMessage ( WebSocket ws,
const WebSocket::Data &  data 
)
virtual
var onMessage ( var  ws,
var  data 
)
virtual
local onMessage ( local  ws,
local  data 
)
virtual
virtual void onOpen ( WebSocket ws)
virtual
var onOpen ( var  ws)
virtual
local onOpen ( local  ws)
virtual

The documentation for this class was generated from the following file: