سؤال

I am using a presistent xmpp connection in android device in a chat app. To keep the connection open I want to use the TCP HEARTBEAT mechanism. I just want to know When the heartbeat step completes:

1. when a packet is sent on server and a response comes from server (Two steps) 
2. Or just packet sending is done from client side (1 step)

How to do it with smack library.Is using KeepAliveManager class?

هل كانت مفيدة؟

المحلول

Just use XMPP Pings to the server as heartbeats. (a)Smack does that automatically. You can tune the settings in PingManager.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top