Cocos2d-x  v3.10
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
SocketIO::SIODelegate Class Referenceabstract

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

Public Member Functions

virtual ~SIODelegate ()
 Destructor of SIODelegate.
 
virtual void onConnect (SIOClient *client)
 This is kept for backwards compatibility, connect is now fired as a socket.io event "connect". More...
 
var onConnect ( var client)
 This is kept for backwards compatibility, connect is now fired as a socket.io event "connect". More...
 
virtual void onMessage (SIOClient *client, const std::string &data)
 This is kept for backwards compatibility, message is now fired as a socket.io event "message". More...
 
virtual void onClose (SIOClient *client)=0
 This is kept for backwards compatibility, close is now fired as a socket.io event "close". More...
 
virtual void onError (SIOClient *client, const std::string &data)=0
 Pure virtual callback function, this function should be overrided by the subclass. More...
 
virtual void fireEventToScript (SIOClient *client, const std::string &eventName, const std::string &data)
 Fire event to script when the related SIOClient object receive the fire event signal. More...
 

Detailed Description

The delegate class to process socket.io events.

Member Function Documentation

virtual void onConnect ( SIOClient client)
inlinevirtual

This is kept for backwards compatibility, connect is now fired as a socket.io event "connect".

This function would be called when the related SIOClient object receive messages that mean it have connected to endpoint successfully.

the connected SIOClient object.

var onConnect ( var  client)
inlinevirtual

This is kept for backwards compatibility, connect is now fired as a socket.io event "connect".

This function would be called when the related SIOClient object receive messages that mean it have connected to endpoint successfully.

the connected SIOClient object.

virtual void onMessage ( SIOClient client,
const std::string &  data 
)
inlinevirtual

This is kept for backwards compatibility, message is now fired as a socket.io event "message".

This function would be called when the related SIOClient object receive message or json message.

the connected SIOClient object. the message,it could be json message

var onMessage ( var  client,
var  data 
)
inlinevirtual

This is kept for backwards compatibility, message is now fired as a socket.io event "message".

This function would be called when the related SIOClient object receive message or json message.

the connected SIOClient object. the message,it could be json message

virtual void onClose ( SIOClient client)
pure virtual

This is kept for backwards compatibility, close is now fired as a socket.io event "close".

This function would be called when the related SIOClient object disconnect or receive disconnect signal.

the connected SIOClient object.

var onClose ( var  client)
pure virtual

This is kept for backwards compatibility, close is now fired as a socket.io event "close".

This function would be called when the related SIOClient object disconnect or receive disconnect signal.

the connected SIOClient object.

virtual void onError ( SIOClient client,
const std::string &  data 
)
pure virtual

Pure virtual callback function, this function should be overrided by the subclass.

This function would be called when the related SIOClient object receive error signal or didn't connect the endpoint but do some network operation, eg.,send and emit,etc.

the connected SIOClient object. the error message

var onError ( var  client,
var  data 
)
pure virtual

Pure virtual callback function, this function should be overrided by the subclass.

This function would be called when the related SIOClient object receive error signal or didn't connect the endpoint but do some network operation, eg.,send and emit,etc.

the connected SIOClient object. the error message

virtual void fireEventToScript ( SIOClient client,
const std::string &  eventName,
const std::string &  data 
)
inlinevirtual

Fire event to script when the related SIOClient object receive the fire event signal.

the connected SIOClient object. the event's name. the event's data information.

var fireEventToScript ( var  client,
var  eventName,
var  data 
)
inlinevirtual

Fire event to script when the related SIOClient object receive the fire event signal.

the connected SIOClient object. the event's name. the event's data information.


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