androidejabberdsmack

smack / ejabberd Connection Timeout


We are using the Pub/Sub mechanism of ejabberd to send messages between multiple clients. The ejabberd version running on the server is 16.04 and the smack library version is 4.1.1.

The publishing and subscribing of messages work fine for a period of time, after some time we get the following exception on the client side :

org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 15000ms (~15s). Used filter: IQReplyFilter: iqAndIdFilter (AndFilter: (OrFilter: (IQTypeFilter: type=error, IQTypeFilter: type=result), StanzaIdFilter: id=T89NL-174)), : fromFilter (OrFilter: (FromMatchesFilter (full): pubsub.unio.com))

Tried googling the cause but was unable to find out a resolution. Any help is appreciated.

Thanks in advance.


Solution

  • I had the same issue. I changed the packet reply timeout for the connection to some suitable value (like 10 seconds) after login. In smack, after connection.login() you can set

    connection.login();
    connection.setPacketReplyTimeout(10000); // 10 sec
    

    UPDATE I tried for smack library version 4.3.2 (and newer), method connection.setPacketReplyTimeout is removed, so use this instead:

    connection.login();
    connection.setReplyTimeout(10000); // 10 sec