jcarlson at nospam.uci.edu
Fri Mar 26 23:00:52 CET 2004
> do someone new how I can do the following?
> I call a method which reads from a socket. So ... this method could hang
> forever and so my call hangs too ...
> So ... I can not change the behavior of this Method, so I have to change my
> I though by forking the call to this function and set a timeout to this
> call, so my program won't hang forever.
> But I don't know how I should do this and if this is the correct/best way to
> do this.
Use non-blocking sockets. Check out the asyncore module, or if you are
feeling ambitious, check out Twisted.
More information about the Python-list