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

A single connection to a socket.io endpoint. More...

#include <SocketIO.h>

Inheritance diagram for SIOClient:
Object

Public Member Functions

 SIOClient (const std::string &host, int port, const std::string &path, SIOClientImpl *impl, SocketIO::SIODelegate &delegate)
 SIOClient ( local host, local port, local path, local impl, local delegate)
virtual ~SIOClient (void)
SocketIO::SIODelegategetDelegate ()
 Returns the delegate for the client. More...
 
void disconnect ()
 Disconnect from the endpoint, onClose will be called on the delegate when comlpete. More...
 
void send (std::string s)
 Send a message to the socket.io server. More...
 
void emit (std::string eventname, std::string args)
 The delegate class to process socket.io events. More...
 
void on (const std::string &eventName, SIOEvent e)
 Used to resgister a socket.io event callback Event argument should be passed using CC_CALLBACK2(&Base::function, this) More...
 
local on ( local eventName, local e)
 Used to resgister a socket.io event callback Event argument should be passed using CC_CALLBACK2(&Base::function, this) More...
 
void setTag (const char *tag)
const char * getTag ()
- Public Member Functions inherited from Object
 Object ()
 Constructor. More...
 
 Object ()
 Constructor. More...
 
virtual ~Object ()
void release ()
 Release the ownership immediately. More...
 
void retain ()
 Retains the ownership. More...
 
Objectautorelease ()
 Release the ownership sometime soon automatically. More...
 
bool isSingleReference () const
 Returns a boolean value that indicates whether there is only one reference to the object. More...
 
unsigned int retainCount () const
 Returns the object's current reference count. More...
 
local retainCount ()
 Returns the object's current reference count. More...
 
virtual bool isEqual (const Object *object)
 Returns a boolean value that indicates whether this object and a given object are equal. More...
 
virtual void acceptVisitor (DataVisitor &visitor)
virtual void update (float dt)

Friends

class SIOClientImpl

Additional Inherited Members

- Public Attributes inherited from Object
unsigned int _ID
 object id, ScriptSupport need public _ID More...
 
int _luaID
 Lua reference id. More...
 
var _luaID
 Lua reference id. More...
 
local _luaID
 Lua reference id. More...
 
- Protected Attributes inherited from Object
unsigned int _reference
 count of references More...
 
var _reference
 count of references More...
 
local _reference
 count of references More...
 
unsigned int _autoReleaseCount
 count of autorelease More...
 
var _autoReleaseCount
 count of autorelease More...
 
local _autoReleaseCount
 count of autorelease More...
 

Detailed Description

A single connection to a socket.io endpoint.

Constructor & Destructor Documentation

SIOClient ( const std::string &  host,
int  port,
const std::string &  path,
SIOClientImpl impl,
SocketIO::SIODelegate delegate 
)
var SIOClient ( var  host,
var  port,
var  path,
var  impl,
var  delegate 
)
local SIOClient ( local  host,
local  port,
local  path,
local  impl,
local  delegate 
)
virtual ~SIOClient ( void  )
virtual
var ~SIOClient (   )
virtual
local ~SIOClient (   )
virtual

Member Function Documentation

void disconnect ( )

Disconnect from the endpoint, onClose will be called on the delegate when comlpete.

var disconnect ( )

Disconnect from the endpoint, onClose will be called on the delegate when comlpete.

local disconnect ( )

Disconnect from the endpoint, onClose will be called on the delegate when comlpete.

void emit ( std::string  eventname,
std::string  args 
)

The delegate class to process socket.io events.

var emit ( var  eventname,
var  args 
)

The delegate class to process socket.io events.

local emit ( local  eventname,
local  args 
)

The delegate class to process socket.io events.

SocketIO::SIODelegate* getDelegate ( )
inline

Returns the delegate for the client.

var getDelegate ( )
inline

Returns the delegate for the client.

local getDelegate ( )
inline

Returns the delegate for the client.

const char* getTag ( )
inline
var getTag ( )
inline
local getTag ( )
inline
void on ( const std::string &  eventName,
SIOEvent  e 
)

Used to resgister a socket.io event callback Event argument should be passed using CC_CALLBACK2(&Base::function, this)

var on ( var  eventName,
var  e 
)

Used to resgister a socket.io event callback Event argument should be passed using CC_CALLBACK2(&Base::function, this)

local on ( local  eventName,
local  e 
)

Used to resgister a socket.io event callback Event argument should be passed using CC_CALLBACK2(&Base::function, this)

void send ( std::string  s)

Send a message to the socket.io server.

var send ( var  s)

Send a message to the socket.io server.

local send ( local  s)

Send a message to the socket.io server.

void setTag ( const char *  tag)
inline
var setTag ( var  tag)
inline
local setTag ( local  tag)
inline

Friends And Related Function Documentation

friend class SIOClientImpl
friend
var SIOClientImpl
friend
local SIOClientImpl
friend

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