[JDEV] Multiple logins
Todd Bradley
TBradley at jabber.com
Thu May 24 12:10:59 CDT 2001
I definitely like where you're headed with this. As someone else pointed
out, Jabber needs much more explanatory errors. Right now, the client knows
nothing about the reason for why it was disconnected from the server.
Also, it's smart to have a better reconnect timeout algorithm than most
clients use. The one I like the most is a geometrically increasing
reconnect timer. So, when you first get disconnected, you try to reconnect
after 20 seconds. If that doesn't work, then you wait 40 more seconds. If
that doesn't work, you wait for 80 more seconds. And so on. That's how the
new version of Gabber works now, I'm told (though I haven't tried it
myself).
Todd.
-----Original Message-----
From: Jens Alfke [mailto:jens at mac.com]
Sent: Thursday, May 24, 2001 10:26 AM
To: jdev at jabber.org
Subject: Re: [JDEV] Multiple logins
IMHO, if a client is disconnected by the server [receives an <error> and
</stream>] it should not automatically attempt to reconnect. There is
probably some good reason it was disconnected, and this thread illustrates
one of the dangers of automatic reconnects. It'd be better to put up a
dialog box with "Reconnect" and "Cancel" buttons and let the user decide.
(Having a meaningful error code and message to display in the dialog would
be even better, of course.)
In the event of a network-level disconnect, where the stream isn't properly
closed, automatic reconnect might still be a good idea. It would help if the
client could use some kind of OS-specific functionality* to determine
whether the network is still up or not — if I unplug the Ethernet from my
laptop I don't want the client to start an infinite series of reconnect
attempts, nor do I want it to start dialing the phone to my ISP without my
intervention.
—Jens
* In the case of Mac OS 9 there's an OTTCPWillDial function that's described
in some tech note, and in Mac OS X there's a System Configuration framework
which is not yet documented but whose [open] source can be found in Darwin.
More information about the JDev
mailing list