Re: [Tutor] Thread deamon

2005-08-22 Thread Danny Yoo
On Mon, 22 Aug 2005, Jorge Louis de Castro wrote: > Anyone knows how to setDaemon(True) or pass it as an argument to > start_new_thread() with the code snippet below? > > server.listen(1) > thread.start_new_thread(run_server,(server,)) > > Otherwise the thread stops running when I close the teln

Re: [Tutor] Thread deamon

2005-08-22 Thread Kent Johnson
Jorge Louis de Castro wrote: > Are these two equivalent: > > def run_server(socket): > ... > > 1) > thread = Thread(target=run_server, args=(server,)) > #thread.setDaemon(True) > thread.start() > > 2) > server.listen(1) > thread.start_new_thread(run_server,(server,)) They both start thread

Re: [Tutor] Thread deamon

2005-08-22 Thread Pierre Barbier de Reuille
Well, I don't know how it works on Windows, but on UNIX, if you want to create a deamon able to stay alive when you deconnect you "just" have to catch the HUP signal and ... do nothing of it :) By default this signal exit the application. You have two ways of doing so : 1 - use the standard signa

Re: [Tutor] Thread deamon

2005-08-22 Thread Jorge Louis de Castro
Ok, better question. Are these two equivalent: def run_server(socket): ... 1) thread = Thread(target=run_server, args=(server,)) #thread.setDaemon(True) thread.start() 2) server.listen(1) thread.start_new_thread(run_server,(server,)) So that I can uncomment the setDaemon() method? chrs j

[Tutor] Thread deamon

2005-08-22 Thread Jorge Louis de Castro
Hi, Anyone knows how to setDaemon(True) or pass it as an argument to start_new_thread() with the code snippet below? server.listen(1) thread.start_new_thread(run_server,(server,)) Otherwise the thread stops running when I close the telnet client (even using Unix's & operator for background ru