<div style="line-height:19.7999992370605px"><div class="nD">> The standard library and nonblocking can't be used in the same sentence.<br></div></div><div style="line-height:19.7999992370605px"><div class="F3hlO"><br></div><div class="F3hlO">python 2.x stdlib has no high level support of *async* code. There is trollius library that ports asyncio to py2 though.</div><div class="F3hlO"><br></div><div class="F3hlO">I was a bit quick in my first anwser. W<span style="line-height:19.7999992370605px">hat you want is to prevent the socket to wait indefinetly for data (based on strace output) which is done with socket.setblocking/settimeout [1]. asynchronous (asyncio) is something else, and you would still need to handle blocking I think.</span></div><div class="F3hlO"><span style="line-height:19.7999992370605px"><br></span></div><div class="F3hlO"><span style="line-height:19.7999992370605px">There is contentbrowser [2] which is somekind of web proxy.</span></div><div class="F3hlO"><span style="line-height:19.7999992370605px"><br></span></div><div class="F3hlO"><span style="line-height:19.7999992370605px">IMO, python 2 -> python 3 is not a big leap. Some things are better in python 3.</span></div><div class="F3hlO"><br></div><div class="F3hlO"><br></div><div class="F3hlO">[1] <a href="https://docs.python.org/2/library/socket.html#socket.socket.setblocking">https://docs.python.org/2/library/socket.html#socket.socket.setblocking</a></div><div class="F3hlO">[2] <a href="https://bitbucket.org/david/contentbrowser/src">https://bitbucket.org/david/contentbrowser/src</a></div><div class="F3hlO"><br></div><div class="F3hlO"><br></div><div class="F3hlO"><br></div><div class="F3hlO"><br></div></div><br><div class="gmail_quote">On Tue Feb 03 2015 at 2:00:27 PM Yassine Chaouche <yacinechaouche@yahoo.com.dmarc.invalid> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tuesday, February 3, 2015 at 12:35:32 PM UTC+1, Marko Rauhamaa wrote:<br>
<br>
> So far I've been happy with select.epoll(), socket.socket() and ten<br>
> fingers.<br>
> Marko<br>
<br>
There's already software written to take care of much of the HTTP stuff protocol stuff, the headers etc. I wouldn't rewrite it. I prefer to monkey patch parts of existing code rather then rewrite all of it.<br>
<br>
But your comment is interesting because, as I understand it, a non-blocking web server is simply a matter of setting timeouts on sockets, catch the exceptions and move on. I don't know why wouldn't that be possible with python stdlib ?<br>
<br>
<br>
> The standard library and nonblocking can't be used in the same sentence.<br>
<br>
?<br>
--<br>
<a href="https://mail.python.org/mailman/listinfo/python-list" target="_blank">https://mail.python.org/<u></u>mailman/listinfo/python-list</a><br>
</blockquote></div>