powered by Jive Software

Some question about the max Clients connection

I tried to test the max Clients of JM,so I made a class named XMPPClient which extends Thread,In the run method a connection is created and it communicated with some other user randomly;In another class I started some XMPPClient threads,but when the clients number up to 100(not exactly,but when the number is 30,it works),there is an exception:

XMPPError connecting to hy.test.net:5222.: (502)

caused by: java.net.ConnectException: Connection refused: connect

at org.jivesoftware.smack.XMPPConnection.chatDeamon(String toUser)

String newMessage = “test”;

Chat.setFilteredOnThreadID(false);

Chat newChat = conn.createChat(toUser);

try {

newChat.sendMessage(newMessage);

while (true) {

Message message = newChat.nextMessage();

this.sleep(1000);

String to = getAvailableClient();

newChat = conn.createChat(to);

newChat.sendMessage(newMessage);

}

}catch …

By the way,If I just create a connection as below,iIt can increase to more than 700 connections till there is no memory.

XMPPClient[] clients = new XMPPClient[num];

String user = “hy”;

for (int i = 0; i < num; i++) {

clients[i] = new XMPPClient();

clients[i].createConnection(“hy.test.net”, 5222);

clients[i].login(user, user, String.valueOf(i));

}

Can you check the error log in Jive Messenger to see if there are any errors?

-Matt

I check the logs and found an error like this:

2005.10.12 20:17:27 [org.jivesoftware.messenger.handler.PresenceUpdateHandler.process(PresenceUpdat eHandler.java:130)

] Internal server error

java.lang.NullPointerException

at org.jivesoftware.messenger.SessionManager.sessionAvailable(SessionManager.java: 532)

at org.jivesoftware.messenger.ClientSession.setPresence(ClientSession.java:479)

at org.jivesoftware.messenger.handler.PresenceUpdateHandler.process(PresenceUpdate Handler.java:92)

at org.jivesoftware.messenger.handler.PresenceUpdateHandler.process(PresenceUpdate Handler.java:141)

at org.jivesoftware.messenger.PresenceRouter.handle(PresenceRouter.java:87)

at org.jivesoftware.messenger.PresenceRouter.route(PresenceRouter.java:61)

at org.jivesoftware.messenger.PacketRouter.route(PacketRouter.java:73)

at org.jivesoftware.messenger.net.SocketReader.processPresence(SocketReader.java:3 01)

at org.jivesoftware.messenger.net.ClientSocketReader.processPresence(ClientSocketR eader.java:49)

at org.jivesoftware.messenger.net.SocketReader.readStream(SocketReader.java:208)

at org.jivesoftware.messenger.net.SocketReader.run(SocketReader.java:111)

at java.lang.Thread.run(Thread.java:595)

Does it useful?

Message was edited by:

justinhy