Cocos2d-x  v3.17
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
SocketIO Class Reference

Singleton and wrapper class to provide static creation method as well as registry of all sockets. More...

Classes

class  SIODelegate
 The delegate class to process socket.io events. More...
 

Static Public Member Functions

static SocketIOgetInstance ()
 Get instance of SocketIO. More...
 
var getInstance ()
 Get instance of SocketIO. More...
 
static SIOClientconnect (const std::string &uri, SocketIO::SIODelegate &delegate)
 Static client creation method, similar to socketio.connect(uri) in JS. More...
 
static SIOClientconnect (const std::string &uri, SocketIO::SIODelegate &delegate, const std::string &caFilePath)
 Static client creation method, similar to socketio.connect(uri) in JS. More...
 
var connect ( var uri, var delegate, var caFilePath)
 Static client creation method, similar to socketio.connect(uri) in JS. More...
 
static SIOClientconnect (SocketIO::SIODelegate &delegate, const std::string &uri)
 Static client creation method, similar to socketio.connect(uri) in JS. More...
 

Detailed Description

Singleton and wrapper class to provide static creation method as well as registry of all sockets.

Member Function Documentation

static SocketIO* getInstance ( )
static

Get instance of SocketIO.

Returns
SocketIO* the instance of SocketIO.
var getInstance ( )
static

Get instance of SocketIO.

Returns
SocketIO* the instance of SocketIO.
static SIOClient* connect ( const std::string &  uri,
SocketIO::SIODelegate delegate 
)
static

Static client creation method, similar to socketio.connect(uri) in JS.

Parameters
urithe URI of the socket.io server.
delegatethe delegate which want to receive events from the socket.io client.
Returns
SIOClient* an initialized SIOClient if connected successfully, otherwise nullptr.
var connect ( var  uri,
var  delegate 
)
static

Static client creation method, similar to socketio.connect(uri) in JS.

Parameters
urithe URI of the socket.io server.
delegatethe delegate which want to receive events from the socket.io client.
Returns
SIOClient* an initialized SIOClient if connected successfully, otherwise nullptr.
static SIOClient* connect ( const std::string &  uri,
SocketIO::SIODelegate delegate,
const std::string &  caFilePath 
)
static

Static client creation method, similar to socketio.connect(uri) in JS.

Parameters
urithe URI of the socket.io server.
delegatethe delegate which want to receive events from the socket.io client.
caFilePathThe ca file path for wss connection
Returns
SIOClient* an initialized SIOClient if connected successfully, otherwise nullptr.
var connect ( var  uri,
var  delegate,
var  caFilePath 
)
static

Static client creation method, similar to socketio.connect(uri) in JS.

Parameters
urithe URI of the socket.io server.
delegatethe delegate which want to receive events from the socket.io client.
caFilePathThe ca file path for wss connection
Returns
SIOClient* an initialized SIOClient if connected successfully, otherwise nullptr.
static SIOClient* connect ( SocketIO::SIODelegate delegate,
const std::string &  uri 
)
static

Static client creation method, similar to socketio.connect(uri) in JS.

Parameters
delegatethe delegate which want to receive events from the socket.io client.
urithe URI of the socket.io server.
Returns
SIOClient* an initialized SIOClient if connected successfully, otherwise nullptr.
var connect ( var  delegate,
var  uri 
)
static

Static client creation method, similar to socketio.connect(uri) in JS.

Parameters
delegatethe delegate which want to receive events from the socket.io client.
urithe URI of the socket.io server.
Returns
SIOClient* an initialized SIOClient if connected successfully, otherwise nullptr.

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