powered by Jive Software

Proper Disconnect Handling

Hello -

I am running 4.1 Smack, and there does not seem to be a lot of documentation around proper error handling, especially around MUC re-joining. I have implemented all the listeners that i feel are necessary but when a disconnect happens (java.net connection error), the Connection listener is fired, i end up re-connecting properly, but when trying to re-join the rooms, i get the common “Packet reply timeout error”. I tried leaving and then joining, but no luck. My guess is something is getting stuck with the connection state.

org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 60000ms (~60s). Used filter: AndFilter: (FromMatchesFilter (full): someJID@conf.hipchat.com/forme, StanzaTypeFilter: Presence).

at org.jivesoftware.smack.SmackException$NoResponseException.newWith(SmackExceptio n.java:106)

at org.jivesoftware.smack.SmackException$NoResponseException.newWith(SmackExceptio n.java:90)

at org.jivesoftware.smack.PacketCollector.nextResultOrThrow(PacketCollector.java:2 29)

at org.jivesoftware.smackx.muc.MultiUserChat.enter(MultiUserChat.java:311)

at org.jivesoftware.smackx.muc.MultiUserChat.join(MultiUserChat.java:495)

Are there any good reference implementations of handling these issues in smack ?

My sample (scala) code is here for the HipChat class i created

hipchat.scala · GitHub

Thanks

A