[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: network process timeouts
From: |
Ted Zlatanov |
Subject: |
Re: network process timeouts |
Date: |
Fri, 23 Sep 2016 09:03:04 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
On Thu, 22 Sep 2016 23:51:21 +0200 Lars Ingebrigtsen <address@hidden> wrote:
LI> Ted Zlatanov <address@hidden> writes:
>> OK... so I shouldn't bother? Or I'm approaching it wrong? I thought
>> having a timeout in `make-network-process' was the right place for a
>> global timeout per process, and then the underlying implementation can
>> choose what to do with that parameter.
LI> What would the timeout be for? DNS resolution, socket connection, TLS
LI> negotiation or protocol negotiation? I think having a parameter for a
LI> timeout for the first three would perhaps be nice if you're programming
LI> synchronous network connection stuff (for instance if you're writing
LI> something to probe hosts to see whether they're listening to a port),
LI> but it's still not quite enough to be generally useful, I think?
If it helps users connecting to network services, I think it's a good
thing, even if it's not everywhere. In this case, I think we can add
setsockopt() and GnuTLS calls to implement some timeouts.
LI> If you look at, for instance, `url-retrieve-synchronously', it does an
LI> asynchronous connection and then loops waiting for it to finish whatever
LI> it's doing. Adding a timeout to that function would just involve, well,
LI> adding a timeout to that function, and it would not pass that timeout on
LI> to the lower levels.
LI> So in that use case it's not useful, but perhaps you see other use cases
LI> where this is useful?
Yes. Gnus to IMAP/NNTP for instance. Plus we should look at making the
HTTP protocol handlers better with respect to timeouts, I think, but
these are gradual ELisp improvements. The C improvements are the foundation.
Ted