[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Non-blocking HTTP request with socket.http and copas
- From: Coda Highland <chighland@...>
- Date: Sun, 27 Jul 2014 16:01:16 -0700
On Sun, Jul 27, 2014 at 3:55 PM, Paul K <firstname.lastname@example.org> wrote:
> It works well for me on Windows, but still blocks on requests for
> non-existing addresses.
That's because connect() includes a DNS lookup, and DNS resolution on
Windows is synchronous. Most programs work around this problem using
threads. It's kinda lame.
> The current logic also doesn't work when http.TIMEOUT is set to 0
> instead of a small non-zero value. The result is still sufficiently
> good for me, but I'd be interested to know how to make it work for 0
> timeout as well.
What's the expected behavior of a zero timeout? I would expect it to
never succeed at all, because no packet ever has zero latency.