How to exit from a loop that is waiting on a blocking socket call?
On Wednesday, November 05, 1997 3:41 PM, Fredrik Lundh
Quote:
> >order to be able to implement a timeout) then the call fails with
winsock error
> >10035.
> Error code 10035 (or 35 on Unix) means that the operation
> would block (there's no pending connections, in this case).
> You simply have to wait a while and call accept again.
Thanks for that. I assume you mean that I can just trap the exception and
continue? That will solve the problem nicely.
Quote:
> But frankly, the best way to program sockets with
python > is to use Sam Rushing's async library, available via:
I have this (thanks Sam!) but do not yet feel confident enough to produce a
new app with it. In this particular case there is a secondary
consideration - my Python SMTP server is a prototype for the real one, to
be coded in C++ (delivering a Python app is not an option here), and I
wanted to use a programming model that could be used easily by the C++
programmer.
I think that Sam's model is an excellent way to write something like this,
but I do not yet understand it well enough to be able to re-do it in C++.
Richard