SocketServer question

Nagy László nagylzs at freemail.hu
Sun Feb 16 09:37:07 EST 2003


>
>
>>Another important question: when I call server.handle_request() it
>>will block until
>>an incoming connection arrives. Meanwhile there can be other handler
>>threads running.
>>This way I'm unable to stop the server because the main thread is
>>blocked. Is there
>>a way to give a timeout for handle_request so I can preiodically check
>>if it is time
>>to stop the server? If not, how can I stop the server gracefully?
>>(I would like to stop or restart the server using a client connected
>>to it.)
>>    
>>
>
>This is what I do:  by wrapping the call to handle_request with
>select.select(), you can achieve a simple timeout.  Simply calling this
>thread's join() method will set the flag, and within a second the select
>call will timeout and not re-enter the loop, and finish.
>  
>
Thanks, this is what I needed.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20030216/870fdf1f/attachment.html>


More information about the Python-list mailing list