Connection stability during network outage. (Issue 23)

9 views
Skip to first unread message

KevM

unread,
Apr 29, 2008, 1:11:03 PM4/29/08
to jabber-net
I am trying to write a windows service that uses jabber-net to
communicate with a Jabber server. Everything is working great. I am
trying to make sure the connection to the server is resilient. I had a
scenario occur where network connectivity with the server was lost and
the auto reconnection did not occur.

I can reproduce this scenario by connecting to the server. Releasing
my network interface's IP by doing an "ipconfig /release" and
"ipconfig /renew" If the connection comes back immediately a
reconnection occurs. If the connection is not restored within 20
seconds I get this exception:

bedrock.net.AsyncSocketConnectionException: Bad host: jabber80.com

Can anyone on this list speak to this behavior. Is this a bug. Does
this work as expected? I am willing to put my own connection
management code around the JabberClient's connection but I just wanted
to check with the community to see if there was a best practice I was
missing or a jabber-net wizard out there with a good idea.

I have created this issue to capture this problem:
http://code.google.com/p/jabber-net/issues/detail?id=23

Joe Hildebrand

unread,
Apr 29, 2008, 3:39:49 PM4/29/08
to jabbe...@googlegroups.com
The intent is that for recoverable errors, auto-reconnection happens, but
for non-recoverable ones (like invalid DNS), reconnection stops.

For the moment, I would just turn auto-reconnect off, and handle reconnects
yourself in OnDisconnected and OnError.

For the future, let's have a discussion about what we should do on different
sorts of failure modes; it's possible that the current approach isn't right.

Miguel Díaz Macedo

unread,
Apr 30, 2008, 12:00:51 PM4/30/08
to jabbe...@googlegroups.com
Nice comment, im going to implement it on my service

Thanks Joe
--
Saludos
Miguel

KevM

unread,
May 15, 2008, 9:33:01 AM5/15/08
to jabber-net
Thank you for some reason I missed this response. Thank you for the
guidance.

I would argue that DNS resolution failing is just a flavor of a
dropped connection. I have struggled with similar requirements systems
having fatal and non-fatal classes of errors exhibiting different
retry/recovery mechanisms. It was a pain as one customer's fatal "stop
the service" failure is another's "just log it and retry later". In
general I vote for don't give up and try again later.

Unfortunately, I have moved over to agXmpp for now. It would be easy
to switch back as I have my XMPP library implementation isolated
behind an IXMPPConnection interface.

Kevin Miller

On Apr 29, 2:39 pm, Joe Hildebrand <hil...@gmail.com> wrote:
> The intent is that for recoverable errors, auto-reconnection happens, but
> for non-recoverable ones (like invalid DNS), reconnection stops.
>
> For the moment, I would just turn auto-reconnect off, and handle reconnects
> yourself in OnDisconnected and OnError.
>
> For the future, let's have a discussion about what we should do on different
> sorts of failure modes; it's possible that the current approach isn't right.
>
Reply all
Reply to author
Forward
0 new messages