I experience a quite disturbing behavior using smack to build a XMPP Client for connecting to MSN and Gtalk. I can set up the connection successfully and I can chat with my application.
But in MSN case (Not Gtalk), when I try to disconnect from MSN service. Sometimes I’m getting this exception :
java.lang.IllegalStateException: Not connected to server.at org.jivesoftware.smack.XMPPConnection.sendPacket(XMPPConnection.java:445)
In catch block of this exception, I’m setting up new connection. and then send disconnect again. In that case , I can disconnect from MSN network. But sometimes couple of seconds user is appear online again to its buddies.
When i run this comment in Solaris, i can see a lot of leak connections :
netstat -an|grep 5222
tcp 0 0 22.214.171.124:54845 126.96.36.199:5222 ESTABLISHED
tcp 0 186 188.8.131.52:60223 184.108.40.206:5222 ESTABLISHED
tcp 0 0 220.127.116.11:36584 18.104.22.168:5222 ESTABLISHED
tcp 0 0 22.214.171.124:45535 126.96.36.199:5222 ESTABLISHED
tcp 0 0 188.8.131.52:55885 184.108.40.206:5222 ESTABLISHED
tcp 0 0 220.127.116.11:60628 18.104.22.168:5222 ESTABLISHED
Please help me with these issue. This issue is very critical for our application.