Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
bilalkhan #1
Member since Oct 2016 · 81 posts · Location: Pakistan
Group memberships: Members
Show profile · Link to this post
Subject: what is the purpose of keepaliveinterval and alive property
am working on client side autoreconnect using agsxmpp, when i drop my connection onclose get call after few time, this is becuase of keepaliveinterval=120 seconds?

what is the purpose of alive and keepalive interval property?
Avatar
Alex #2
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by bilalkhan:
am working on client side autoreconnect using agsxmpp, when i drop my connection onclose get call after few time, this is becuase of keepaliveinterval=120 seconds?

I don't think so.

Quote by bilalkhan:
what is the purpose of alive and keepalive interval property?

It keeps the connection alive when you are sending or receiving no traffic on your connection for a while.
There are some routers, proxies and network stacks which would kill idle connections otherwise.

Alex
Avatar
bilalkhan #3
Member since Oct 2016 · 81 posts · Location: Pakistan
Group memberships: Members
Show profile · Link to this post
alex do you have any example of autoreconnect the client, when the client internet get's offline, when the server get's offline? am trying hard but couldn't find a stable solution.

what is the puropose of AutoResolveConnectServer=TRUE?
thanks
Avatar
Alex #4
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
no, we have only reconnect example for MatriX.

AutoResolveConnectServer has nothing to do with reconnection. When AutoResolveConnectServer is true then the library tries to resolve you host from the SRV records. In XMPP SRV records are used to set your hostsnames with priorities. Similar to MX records in mailservers.

Implementing a reconnect logic is pretty simple.When you get an OnClose event then just start a timer which tries to reconnect eg. 10 seconds after you got the close. If this fails again increase the 10 seconds to 20 and try to reconnect.

Usually when the connection fails something is wrong, like lost internet, switching access points etc... So calling Open directly in the OnClose event is not a good idea.

Alex
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