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
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
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
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
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