Posts Tagged ‘config XML’

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: , , , , , , , , ,

Smartfox Server – Chapter 04-Server side Config-part-1

October 3rd, 2010 by aabhaanjan


Server side Config -Part-1


Lets discuss now the Server side Config:

Here we can see many nodes in server side config XML . Let me explain each node and its working .

server side config -part-1

ServerIP :  It specify the  IP address of server.

ServerPort : It specify the  Port of server.

AutoSendPolicyFile :  It is a Boolean value .If set to TRUE it allows SmartFoxServer to automatically generate a cross-domain policy file to enable Flash player 7 ( or later) to connect outside the current domain.  This is used for  those   SWF files  which are  located in different domains.  We often get cross domain error while we try to connect with swf files which are in different domain. To avoid this we need to set it true.

MaxUserIdleTime : The time is expressed in seconds and it represents the maximum time allowed for an idle client. After that time, idle users are automatically disconnected by the server

MaxSocketIdleTime : it comes with the version 1.6.3 .It is an interval of seconds which represents the maximum time a connection can stay idle before the server forces the disconnection. The most important point with this is it is  valid only for client connections that still have to log in the server and create a User session. Once the user is logged in this parameter is ignored and the auto-disconnection will be according to the MaxUserIdleTime parameter.

MaxRoomVars : The maximum number of room variables that can be created in a single room.

MaxUserVars : The maximum number of user variables that can be created by a single user.

UserVarsOptimization : it comes with  the version 1.6.3. It allows to receive only real changes in user variables, avoiding variables that didn’t change to be retransmitted. It helps to improves bandwidth usage when many variables are being used.

Previous Chapter

Next Chapter

Tags: , , , , , , , , , , , , , , , , , ,