socket.recvfrom() & sendto()

Ron Johnson ron.l.johnson at
Wed May 9 15:51:12 EDT 2001

Fredrik Lundh wrote:

> Ron Johnson wrote:
>> > It is never "stalled" at a select(); asyncore uses non-blocking
>> > sockets.  select() returns immediately with lists of those sockets
>> > which are ready to write and those sockets which are ready to read.
>> 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.
> if you set the select timeout short enough, you can poll the network
> from an UI background task (e.g. Tk's idletask).

Ah.  A pseudo-thread.

> for heavier loads, it's probably better to use a separate UI thread
> (if you really like threads, add a dispatcher thread and one or more
> worker threads to the mix as well...)

My system will have a very light load, so the UI background task 
should be adequate.  My only problem now is that not only must I
learn asyncore, but also Tkinter at the same time.  Onward to glory!

 Ron Johnson, Jr.        Home: ron.l.johnson at
 Jefferson, LA  USA
 "Is Python better or worse than Perl?"
  "Perl is worse than Python because people wanted it 
   worse." -Larry Wall, 10/14/1998

More information about the Python-list mailing list