powered by Jive Software

SmackConfiguration.setPacketReplyTimeout

Hi there,

int packetReplyTimeout = 15000; // 15 seconds.

I’ve been trying to use this **SmackConfiguration.setPacketReplyTimeout(packetReplyTimeout); **I’ve been trying to use this in a chat app, but I cannot get it to work.

I have this use case:

User A is sending messages to User B, at this point, both users are online, and everything is working as expected, the problem comes when for some reason, User B gets disconnected, let’s say he lost connection, so there’s no time to tell the server that I went offline. So then when User A sends a new message to User B, there’s no response back within the packetReplyTimeout value (15 seconds).

After some time, I get the next stanza:

message

User session terminated

So I look for the <archived extension, and if it is there, then I mark the message as sent, the problem is that sometimes that stanza is coming after 20 seconds, or sometimes after 5 minutes, so I would like to get the SmackConfiguration.setPacketReplyTimeout(packetReplyTimeout); working, so I can notify this before that long period of time.

And finally my question would be: is there anything that I need to do to get the SmackConfiguration.setPacketReplyTimeout(packetReplyTimeout); to work?

I am using 4.2.0 library version.