Cocos2d-x  4.0.0
Classes | Static Public Member Functions | List of all members
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.
 
static SIOClientconnect (const std::string &uri, SocketIO::SIODelegate &delegate)
 Static client creation method, similar to socketio.connect(uri) in JS.
 
static SIOClientconnect (const std::string &uri, SocketIO::SIODelegate &delegate, const std::string &caFilePath)
 Static client creation method, similar to socketio.connect(uri) in JS.
 

Detailed Description

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

NA

Member Function Documentation

static SocketIO* 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.
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.

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