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.

Reply via email to