Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Avatar
skhanna #1
Member since Jul 2016 · 73 posts · Location: Indore
Group memberships: Members
Show profile · Link to this post
Subject: Reconnect automatically
Hi Alex,

Is there any way to reconnect automatically if connection is disconnected

Thanks in Advance,
Sanjeev
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
no, its up to you. Take a look at the Reconnect example from here:
https://gitlab.com/matrix-xmpp/samples/tree/master/csharp/…

Different software products and requirements require different reconnect logic. This is why we leave the implementation up to you.
Avatar
skhanna #3
Member since Jul 2016 · 73 posts · Location: Indore
Group memberships: Members
Show profile · Link to this post
Hi Alex,

I review reconnect code. But I checked that connection close event execute after 2-3 minutes of disconnection. Any reson.

Thanks,
Sanjeev
Avatar
Alex #4
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
sometimes a broken socket connection can be only detected when you try to send data.
You can try to lower the keep alive interval to get faster notifications. Whenever .NET gives us a socket exception we forward it to you.

Alex
Avatar
skhanna #5
Member since Jul 2016 · 73 posts · Location: Indore
Group memberships: Members
Show profile · Link to this post
How to know the connection is close. Is there any property in XmppClient object?
Avatar
Alex #6
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
You get the OnClose event whenever you loose your connection.
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: