Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
vantojo #1
Member since Nov 2013 · 9 posts
Group memberships: Members
Show profile · Link to this post
Subject: jabber.at disconnects when agsxmpp client does not respond to server ping
I have two accounts at jabber.at

the first I connect to with xabber/android.  It connects, receives messages, and stays connected until I logoff, regardless if there is any activity or not.

the second I connect to with agsxmpp/c#.  It connects, sends messages, and then looses the connection after 5 minutes, if there is no activity.

I contacted jabber.at and they confirmed that if the client does not respond to a jabber.at server ping, then the server terminates the connection.  This ping was set to 5 minutes.

I have not seen AgsXMPP documentation for how to recognize and then respond to a server ping.  But this would solve my problem.

In the connection string I have set KeepAlive = true;  but it does not make any difference.

Please advise
Avatar
Alex #2
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
XMPP pings are defined here:
http://xmpp.org/extensions/xep-0199.html

When a server sends to you a ping than it wants to know if you are still "alive". When you don't reply to the ping then the server closes the connection because it assumes you lots it.
So if jabber.at is sending Pings, then check in your client for pings and reply to them when you get them.

Keep Alive is something different.

Alex
Avatar
vantojo #3
Member since Nov 2013 · 9 posts
Group memberships: Members
Show profile · Link to this post
Hi Alex,

thank you.

Can you point me to some AgsXMPP/C# examples?  The standards are in Java, I believe.
Avatar
Alex #4
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
The XEPS include only Xml examples, tehy are noit related to any library or programming language.

You should find your answer here:
http://forum.ag-software.net/post/5159

please let me know if this hepls.
Avatar
vantojo #5
Member since Nov 2013 · 9 posts
Group memberships: Members
Show profile · Link to this post
The folks at jabber.at weren't sure if the client sent the ping that it would work.  It could be that I have to respond to their ping.  They pointed me to code here

http://sfdocsamples.googlecode.com/svn-history/r95/trunk/r…

Perhaps I can find what I need in there.  I'm not much of a C# coder (other legacy yes) so I mostly find examples and code snippets.
Avatar
Alex #6
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
right there is also all you need in this link.
Avatar
vantojo #7
Member since Nov 2013 · 9 posts
Group memberships: Members
Show profile · Link to this post
it seems that this is the code that responds to the server ping...

  1. else if (iq.Query is agsXMPP.protocol.extensions.ping.Ping)
  2. {
  3.     iq.SwitchDirection();
  4.     iq.Type = IqType.result;
  5.     agsXMPP.protocol.extensions.ping.Ping ping = iq.Query as agsXMPP.protocol.extensions.ping.Ping;
  6.     Jabber.xmpp.Send(iq);
  7. }
This post was edited on 2014-12-23, 20:03 by Alex.
Avatar
Alex #8
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
correct
Avatar
vantojo #9
Member since Nov 2013 · 9 posts
Group memberships: Members
Show profile · Link to this post
Thank you.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS