unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Lars Magne Ingebrigtsen <larsi@gnus.org>
Cc: emacs-devel@gnu.org
Subject: Re: Determining whether a TCP connection is up
Date: Mon, 12 Aug 2013 21:52:34 -0400	[thread overview]
Message-ID: <jwvob92pdju.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m3r4dysun6.fsf@stories.gnus.org> (Lars Magne Ingebrigtsen's message of "Mon, 12 Aug 2013 19:09:49 +0200")

>> Another option is to kill connections after some time of inactivity,
>> rather than leave them open and suffer a timeout next time we need to
>> use it.
> Yes.  But it's not very nice for the servers.  NNTP and IMAP servers do
> the access control stuff upon connection, which can be
> resource-intensive.

Those servers don't like to have thousands of idle connections tying up
resources either.
If you kill your connections after a reasonable amount of inactivity,
the cost of connection is not that bad.

> The earliest version of the ... Mozilla? or whatever they were called at
> the time? (I think) ... news reader famously was written in a
> connection-less method which made a news connection for every action it
> made.  It DDoS-ed several NNTP servers.

I think that "after some time of inactivity" is not quite the same as "a
news connection for every action".
E.g.: Use (process-put <proc> 'last-time (float-time)) in the process
filter, then use an idle timer to kill connections older than some
limit.  And when sending a command, check that last-time stamp, and
consider the process dead if it's older than the limit (in case the
idle-timer didn't do its job (yet) for some reason).


        Stefan



      reply	other threads:[~2013-08-13  1:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-03 12:30 Determining whether a TCP connection is up Lars Magne Ingebrigtsen
2013-08-03 14:09 ` Paul Eggert
2013-08-03 16:01 ` Julien Danjou
2013-08-05  2:12   ` Lars Magne Ingebrigtsen
2013-08-05  2:33     ` chad
2013-08-05  2:37       ` Lars Magne Ingebrigtsen
2013-08-05 10:34     ` Julien Danjou
2013-08-05 14:40       ` Stefan Monnier
2013-08-05 15:23         ` Thierry Volpiatto
2013-08-05 15:51         ` Julien Danjou
2013-08-05 17:55       ` Lars Magne Ingebrigtsen
2013-08-06  8:51         ` Julien Danjou
2013-08-06  9:59           ` joakim
2013-08-06 13:36           ` Lars Magne Ingebrigtsen
2013-08-06 21:32             ` Stefan Monnier
2013-08-12 17:09               ` Lars Magne Ingebrigtsen
2013-08-13  1:52                 ` Stefan Monnier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvob92pdju.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).