[Date Prev] [Date Index] [Date Next] [Thread Prev] [Thread Index] [Thread Next]

reconnecting to servers

Doug Hughes doug@gblx.net
Sat, 15 Dec 2001 18:32:18 -0700 (MST)


On Sat, 15 Dec 2001, Bryan Stansell wrote:

> The problem with using a sleep() in the code is that the process does
> just that - it sleeps.  Each process is managing 16 consoles (by
> default) and if it sleeps, all activity for those 16 consoles and
> anyone connected to any of those consoles stops for the length of the
> sleep().  So, just putting a sleep in there doesn't work well.  There
> is a timer that goes off every minute that's used to produce the
> timestamps in the logfiles.  It should be possible to use that
> mechanism, but, again, I haven't put much thought into the impact of
> inserting code there either.
>
> So, yep, should be possible.  Hmm...maybe it would be as simple as
> putting it in the timer loop.  I guess the only other bit I'd like to
> see is a counter of auto-retries and if that hits two or three, it
> stops trying to reconnect.  But, that should be easy as well.
> Hmm...I'm feeling inspired...  :-)
>

yeah, like ntp. it has an alarm every so often and goes through
an array of pointers. null pointers ignored, pointers pointing
to something are checked. You could do the same thing with stuck
consoles, add them to a linked list or array or something like that
that gets checked every so often.

Back to lurking. ;)