From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Determining whether a TCP connection is up Date: Mon, 12 Aug 2013 21:52:34 -0400 Message-ID: References: <87txj64vbx.fsf@dex.adm.naquadah.org> <878v0g1l55.fsf@dex.adm.naquadah.org> <87zjsvxkur.fsf@dex.adm.naquadah.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1376358774 1129 80.91.229.3 (13 Aug 2013 01:52:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 Aug 2013 01:52:54 +0000 (UTC) Cc: emacs-devel@gnu.org To: Lars Magne Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 13 03:52:54 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V93n3-0004C2-1S for ged-emacs-devel@m.gmane.org; Tue, 13 Aug 2013 03:52:53 +0200 Original-Received: from localhost ([::1]:33039 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V93n2-0007Jh-Ns for ged-emacs-devel@m.gmane.org; Mon, 12 Aug 2013 21:52:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V93mt-0007JQ-6Q for emacs-devel@gnu.org; Mon, 12 Aug 2013 21:52:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V93ml-0002dJ-Tc for emacs-devel@gnu.org; Mon, 12 Aug 2013 21:52:43 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:49254) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V93ml-0002dC-Pg for emacs-devel@gnu.org; Mon, 12 Aug 2013 21:52:35 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFLd/Nq/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kLYdxBsEtjRcDg3ADpHqBXoMTgUs X-IPAS-Result: Av4EABK/CFFLd/Nq/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kLYdxBsEtjRcDg3ADpHqBXoMTgUs X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="21581932" Original-Received: from 75-119-243-106.dsl.teksavvy.com (HELO pastel.home) ([75.119.243.106]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 12 Aug 2013 21:52:28 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id C0CFF62E98; Mon, 12 Aug 2013 21:52:34 -0400 (EDT) In-Reply-To: (Lars Magne Ingebrigtsen's message of "Mon, 12 Aug 2013 19:09:49 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:162642 Archived-At: >> 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 '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