cocos2d-x  3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SocketIO::SIODelegate Class Referenceabstract

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

#include <SocketIO.h>

Public Member Functions

virtual ~SIODelegate ()
 Destructor of SIODelegate. More...
 
virtual void onConnect (SIOClient *client)=0
 Pure virtual callback function, this function should be overrided by the subclass. More...
 
virtual void onMessage (SIOClient *client, const std::string &data)=0
 Pure virtual callback function, this function should be overrided by the subclass. More...
 
virtual void onClose (SIOClient *client)=0
 Pure virtual callback function, this function should be overrided by the subclass. More...
 
var onClose ( var client)
 Pure virtual callback function, this function should be overrided by the subclass. More...
 
virtual void onError (SIOClient *client, const std::string &data)=0
 Pure virtual callback function, this function should be overrided by the subclass. More...
 
var onError ( var client, var data)
 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.

Constructor & Destructor Documentation

virtual ~SIODelegate ( )
inlinevirtual

Destructor of SIODelegate.

var ~SIODelegate ( )
inlinevirtual

Destructor of SIODelegate.

Member Function Documentation

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.

Parameters
clientthe connected SIOClient object.
eventNamethe event's name.
datathe 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.

Parameters
clientthe connected SIOClient object.
eventNamethe event's name.
datathe event's data information.
virtual void onClose ( SIOClient client)
pure virtual

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

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

Parameters
clientthe connected SIOClient object.
var onClose ( var  client)
pure virtual

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

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

Parameters
clientthe connected SIOClient object.
virtual void onConnect ( SIOClient client)
pure virtual

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

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

Parameters
clientthe connected SIOClient object.
var onConnect ( var  client)
pure virtual

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

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

Parameters
clientthe 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 wwhen the related SIOClient object recevie error signal or didn't connect the endpoint but do some network operation,eg.,send and emit,etc.

Parameters
clientthe connected SIOClient object.
datathe 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 wwhen the related SIOClient object recevie error signal or didn't connect the endpoint but do some network operation,eg.,send and emit,etc.

Parameters
clientthe connected SIOClient object.
datathe error message
virtual void onMessage ( 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 wwhen the related SIOClient object recevie message or json message.

Parameters
clientthe connected SIOClient object.
datathe message,it could be json message
var onMessage ( var  client,
var  data 
)
pure virtual

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

This function would be called wwhen the related SIOClient object recevie message or json message.

Parameters
clientthe connected SIOClient object.
datathe message,it could be json message

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