socket.recvfrom() & sendto()

Ron Johnson ron.l.johnson at home.com
Wed May 9 00:32:37 EDT 2001


Jonathan Feinberg wrote:

> Ron Johnson <ron.l.johnson at home.com> writes:
> 
>> Since the server can send messages to the client at random and
>> irregular interevals, how can the client accept input from the
>> user at the same time that it is "stalled" at a select() ?
> 
> 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.

-- 
 Ron Johnson, Jr.        Home: ron.l.johnson at home.com
 Jefferson, LA  USA      http://ronandheather.dhs.org
 "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