Posts Tagged ‘config’

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

ChatManager

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

SmartFoxServer Chapter 8 – server side config –part-5

October 10th, 2010 by aabhaanjan

lets move forward with the config :

server side config -part-5

ClientMessagQueue:

Sometimes network doesn’t work in fill speed and not always permit to send the messages in fast speed at the same rate of messages are produced on the server side. In that case SmartFoxServer creates a queue of outgoing message packets that should be sent to the user.

 
QueueSize : Here we specify the size of queue .
MaxAllowedDroppedPackets : Here we specify the amount of
dropped messages that can be tolerated

MaxIncomingQueue : Here we specify the maximum number of  requests that can be enqueued by the server. By default it is 8000.

DeadChannelsPolicy : Here we specify the server policy for dead / closed socket channels.

There are two modes are available:
normal: allows unexpectedly closed or stalled socket connections to live longer in memory.
strict:  this is recommended . It  uses a more efficient way to catch unexpected disconnections or closed channels. Immediately gets rid of closed channels, releasing their resources.

MaxMsgLen :Maximum length of message.

LogMaxSize :  Maximum size of  each log file .

LogMaxFile:Maximum number of file log files which can be created from the server.

Previous Chapter

Next Chapter

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