Simple Chat Application:Part 2

October 18th, 2010 by aabhaanjan

As discussed in our last chapter lets move to the code part more deeply 🙂

So now we need to load the config and establish the connection first  our code will look like this


Lets start with init() function where I am initializing the smartfoxserver’s object and loading the config.

loadConfigData():- Here I am loading the configData which is basically an XML file out side in the folder

containg ip, zone and port.

onConfigLoaded(): This function is called after successful loading of config XML. Inside this function I am calling two more functions named connectionEventsOfSFS() and handleConnectionToSFS().

connectionEventsOfSFS():- here basically I am enabling the SmartFoxServer’s event for onConnection established and on connection lost.

Tags: , , , , , , , , ,