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: Can we set-network-process-option process :keepalive t by default? Date: Thu, 26 Jan 2012 12:18:57 -0500 Message-ID: References: <87ipjya450.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1327598351 16596 80.91.229.12 (26 Jan 2012 17:19:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 26 Jan 2012 17:19:11 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 26 18:19:07 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RqSyY-0004m4-Mn for ged-emacs-devel@m.gmane.org; Thu, 26 Jan 2012 18:19:07 +0100 Original-Received: from localhost ([::1]:59694 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqSyX-000282-Lm for ged-emacs-devel@m.gmane.org; Thu, 26 Jan 2012 12:19:05 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:46526) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqSyR-00026v-Vp for emacs-devel@gnu.org; Thu, 26 Jan 2012 12:19:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RqSyQ-000226-Gv for emacs-devel@gnu.org; Thu, 26 Jan 2012 12:18:59 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:41950) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqSyQ-00021E-E9 for emacs-devel@gnu.org; Thu, 26 Jan 2012 12:18:58 -0500 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q0QHIvWm000381; Thu, 26 Jan 2012 12:18:57 -0500 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 38E7FB4431; Thu, 26 Jan 2012 12:18:57 -0500 (EST) In-Reply-To: <87ipjya450.fsf@lifelogs.com> (Ted Zlatanov's message of "Thu, 26 Jan 2012 09:13:15 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4113=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4113> : streams <723200> : uri <1054166> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 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:147946 Archived-At: > This is the code we use currently on Gnus IMAP and NNTP connections: > (when (and (fboundp 'set-network-process-option) ;; Unavailable in XEmacs. > (fboundp 'process-type) ;; Emacs 22 doesn't provide it. > (eq (process-type process) 'network)) > ;; Use TCP-keepalive so that connections that pass through a NAT router > ;; don't hang when left idle. > (set-network-process-option process :keepalive t)) > I think nowadays it makes sense to set that as the default for all Emacs > network connections (though the user should be able to turn it off, and > the OS has to allow it of course). Can we make that change after 24.1 > is out? I think I'd rather keep the default behavior of Elisp code close to the default behavior of C code in this respect. BTW, instead of process-type, couldn't you use (eq (process-status process) 'open), so as to avoid the (fboundp 'process-type)? Stefan