From: Jonathan Gillette Date: 2002-06-25T01:35:28+09:00 Subject: Re: detecting a socket dropping in multi-threaded app Yep. That's a reasonable idea. As long as you're sure the user's Thread dies, this should work. Firestone, Mark - Technical Support (mark.firestone@gossgraphic.co.uk) wrote: > How about this? My @who data structure is shared with a mutex between the > threads. It keeps a list of the thread id with each person's username and > whatever who is logged on. When someone hangs up, Ruby just kills the > thread (I verified this with an experiment last night...) > > I write a thread that wakes up every so often and checks Thread.current, and > compares that list with the list in @who, and if someone is missing from > Thread.current, zaps them from the list. > > Is this a reasonable idea? > > Thanks, > > Mark -- Jonathan Gillette iNetZ Media