socket.recvfrom() & sendto()

Steve Holden sholden at holdenweb.com
Wed May 9 01:51:27 EDT 2001


"Courageous" <jkraska1 at san.rr.com> wrote in message
news:35jhft8tkhe3japncq3fbbbo0eg4ip5lqa at 4ax.com...
>
> >Not to pick a nit, but doesn't execution stall at select() if
> >there is no data coming in to the server.  For example: a small
> >chat server when no one happens to be chatting.
>
> Asyncronous event-driven programs of this sort typically solve
> this by initiating a time thread which then writes a wakeup connect
> through one of the file descriptors which select is listening on;
> the file descriptor is usually set up early for just this purpose.
>
This seems a little over the top when select.select() can take a fourth
argument, which lets you tell it how long to wait before returning in the
absence of I/O activity...

regards
 Steve





More information about the Python-list mailing list