I am using AGSXMPP Library with C#. Everything works fine except OnPresence
event is not firing when a GTalk user is disconnected from the Internet and the user's status remains as Online. Is there is a way to check for status of the RosterItems
periodically?
Asked
Active
Viewed 1,338 times
1

Libin TK
- 1,477
- 2
- 25
- 46
-
did you create a handler for the onPresence event? – Anuj Kaithwas Apr 25 '13 at 02:13
-
@AnujKaithwas Yes.. the handler is triggering & working when a buddy `Sign Out` using the client. But we are not getting any "unavailable" presence when the user loses the connection. – Libin TK Apr 25 '13 at 04:52
-
1It can take a while until your server detects the loss of the socket connection. As soon as the server detects it it must send the unavailable presence to you. – Alex Apr 25 '13 at 07:03
-
@Alex My Openfire Server is federated with Google Talk. The presence issues are with GTalk Servers. Also I've noticed that GTalk is sending many available presence when a user has been logged in. – Libin TK Apr 25 '13 at 08:49
-
this is how XMPP works. When you mark yourself as online after login you get all precences of your subscribed contacts delivered automatically. – Alex Apr 27 '13 at 13:21
-
@Alex Honestly I know that how it works. What I meant is that GTalk is sending multiple available presences for a single user when he is connected from an Android device. And it doesn't send any unavailable presence for hours (I can't wait any longer) when an Android user turns off the data connection. This is why I am trying to get the status of the contact by querying or something. Thanks – Libin TK Apr 27 '13 at 15:08
-
1check the resource of your multiple presences. They are probably different, which means you get presence from multiple devices/clients. The server should not send the same presence multiple times. When the data connection gets lost then the server SHOULD close this session and send an unavailable presence, if it doesn't its a server bug. As a workaround you can you can try to send a presence probe, see: http://xmpp.org/rfcs/rfc6121.html#presence-probe – Alex Apr 27 '13 at 15:50
-
@Alex I've checked and I can confirm that I am getting multiple presences with same resource name `android_talk4e1f32e76sh` and it doesn't send any unavailable presence after turning off the data connection. How do I use Presence Probe with AGSXMPP and C#? – Libin TK Apr 27 '13 at 16:51
-
@Alex Sadly still GTalk is sending available presence instead of unavailable presence even when my WiFi is turned off. – Libin TK Apr 27 '13 at 16:54
-
it would be help when you add your XML logs to your question. I have not seen such a behavior before with GTalk – Alex Apr 28 '13 at 09:57
-
@Alex You meant the OpenFire logs? I am sorry, I am very new to XMPP and Openfire. Where can I find the logs? – Libin TK Apr 28 '13 at 11:22