sockets - recv with time out

Steve Holden sholden at holdenweb.com
Sun Jan 13 19:54:27 EST 2002


"David Bolen" <db3l at fitlinxx.com> wrote ...
> "Steve Holden" <sholden at holdenweb.com> writes:
>
> > Erm, how would you do a recv() when your program is blocked waiting for
> > select() to return? Non-blocking sockets are an absolute necessity for
this
> > application, and timeoutsocket is the best solution, as Oleg has already
> > said.
>
> Others have answered the specific question, but I just also wanted to
> point out that all timeoutsocket itself is doing is exactly what I
> suggested - in lieu of a straight recv() it selects() and then
> receives.  Although it does temporarily enable non-blocking for calls
> like connect() and accept() and exports the ability for the user of
> the class to set non-blocking as with standard sockets, its default is
> blocking, and it works fine there too.
>
Indeed. 'scuse the brainfart.

regards
 Steve
--
http://www.holdenweb.com/







More information about the Python-list mailing list