From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/78765 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.gnus.general Subject: Re: [gnus git] branch master updated: n0-17-27-g43f8466 =1= nntp.el (nntp-open-connection): Set TCP keepalive option. Date: Mon, 09 May 2011 22:01:19 -0300 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1304989317 4472 80.91.229.12 (10 May 2011 01:01:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 10 May 2011 01:01:57 +0000 (UTC) Cc: ding@gnus.org To: Lars Magne Ingebrigtsen Original-X-From: ding-owner+M27066@lists.math.uh.edu Tue May 10 03:01:53 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QJbKi-0002qx-UL for ding-account@gmane.org; Tue, 10 May 2011 03:01:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1QJbKM-0000BX-Pt; Mon, 09 May 2011 20:01:30 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1QJbKL-0000BI-F7 for ding@lists.math.uh.edu; Mon, 09 May 2011 20:01:29 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1QJbKK-00039L-7E for ding@lists.math.uh.edu; Mon, 09 May 2011 20:01:29 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1QJbKI-0005h0-CZ; Tue, 10 May 2011 03:01:26 +0200 Original-Received: from 213-159-126-200.fibertel.com.ar ([200.126.159.213]:59458 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QJbKG-0002vG-8M; Mon, 09 May 2011 21:01:24 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 0285366152; Mon, 9 May 2011 22:01:19 -0300 (ART) In-Reply-To: (Lars Magne Ingebrigtsen's message of "Tue, 10 May 2011 00:53:06 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Spam-Score: -4.9 (----) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:78765 Archived-At: > Keepalive is usually useful (on the client side) if you have a protocol > where you're just sitting sleeping on a socket. If the server dies, > you'll never get a TCP RST, so the keepalive option will ensure you get > that RST after a while. The use case is the one mentioned in the comment: you sit behind a NAT router. Gnus connects, sends some commands, gets some responses, then sits still for some hours because the user goes on to do something else or reads newsgroup from another server (the machine may be put to sleep in the mean time, but not necessarily). When the user comes back to this newsserver, the IP will often be the same as before, but the NAT router will have completely forgotten about this open TCP connection, so Emacs never receives an RST or anything like that and Gnus just sits there waiting for the answer that'll never come. > (And, besides, if nntp.el needs keepalive, doesn't all network > connections need it?) All the ones that may stay open without activity, yes. Oddly enough nowadays these are rarely used by the "new" protocols like http, video-streaming, etc... Stefan