asyncore and (missing) timeout

Peter Hansen peter at
Mon Jun 23 21:16:32 CEST 2003

Dave Brueck wrote:
> By definition, the readable and writable methods are _supposed_ to return
> values that make sense as asyncore drives its behavior off those values. The
> high CPU problem you're having goes away if you return values that truly
> reflect the state of your app.
> Also, I better include the standard "have you tried Twisted yet?" response -
> many people seem to like it (although there is terrific educational value in
> getting your asyncore-based program working ;-) ).

In cases like this, the best reason to consider using Twisted is that it
is actually somewhat higher level than asyncore, and you don't have to
deal with quite so many minor details.  It's a pretty subtle difference, 
but sockets are tricky enough already that it can be a real help.


More information about the Python-list mailing list