non-blocking sockets and generators
Gary Stephenson
garys at ihug.com.au
Sat May 24 07:04:50 EDT 2003
Whoops. I figured out the answer to my first question anyway.
> def socketAccept( self, s ) :
> while True :
> try :
> ( sock, addr ) = s.accept()
> except :
> yield None
continue # << missing from previous version
> self.addThread( self.createThread( sock, addr ) )
So the exception was thrown err the assignment completed. In the absence of
the (now added) continue statement execution of the last line indeed
proceeded without sock having been assigned to.
However, my _second_ question re the appropriate error class to use survives
intact.
thanx,
gary
More information about the Python-list
mailing list