powered by Jive Software

Advice on the connection object

Hello all,

I am trying to make a web based chat app based on Smack.

I have the following code which I call from a jsp:

//get the connection

public void getConnection(String user, String pwd) throws XMPPException

{

conn = new XMPPConnection(HOST,PORT);

conn.DEBUG_ENABLED = true;

conn.login(user,pwd);

System.out.println(user+“CONNECTED”);

}

public void chat(String message,String user) throws XMPPException

{

Chat chat = conn.createChat(user+"@asterisk1.local/Spark");

chat.sendMessage(message);

}

/code

Question is, how many connections can be established?

What is an efficient method of handling the connections or does Wildfire do this automatically?

TIA!

Hi,

you can establish as many connections as you like. Smack and Wildfire will use some memory for each connection, you may calculate 1 MB for Smack and 1 MB for Wifi for every connection. So if you want to handle 100 users Wifi should have 100 MB memory free and your application/servlet engine should have 100 MB free memory.

Smack and Wifi handle the connections efficient, and you don’'t have any real option to modify the connection handling.

LG