From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/18422 Path: news.gmane.org!.POSTED!not-for-mail From: Sebastian Krause Newsgroups: gmane.emacs.gnus.user Subject: Re: Transparently reconnect to servers after a system suspend Date: Sat, 15 Oct 2016 20:47:38 +0200 Message-ID: References: <87bmylqzcy.fsf@ericabrahamsen.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1476557288 26685 195.159.176.226 (15 Oct 2016 18:48:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 15 Oct 2016 18:48:08 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (darwin) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Sat Oct 15 20:48:04 2016 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvU00-0005vi-FY for gegu-info-gnus-english@m.gmane.org; Sat, 15 Oct 2016 20:48:00 +0200 Original-Received: from localhost ([::1]:52932 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvTzy-0000Oj-U2 for gegu-info-gnus-english@m.gmane.org; Sat, 15 Oct 2016 14:47:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvTzw-0000Ob-E7 for info-gnus-english@gnu.org; Sat, 15 Oct 2016 14:47:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvTzs-0005qf-9j for info-gnus-english@gnu.org; Sat, 15 Oct 2016 14:47:55 -0400 Original-Received: from leo.uberspace.de ([95.143.172.56]:43741) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bvTzs-0005nU-0A for info-gnus-english@gnu.org; Sat, 15 Oct 2016 14:47:52 -0400 Original-Received: (qmail 6248 invoked from network); 15 Oct 2016 18:47:40 -0000 Original-Received: from localhost (HELO localhost) (127.0.0.1) by leo.uberspace.de with SMTP; 15 Oct 2016 18:47:40 -0000 In-Reply-To: <87bmylqzcy.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sat, 15 Oct 2016 10:46:37 -0700") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 95.143.172.56 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Original-Sender: "info-gnus-english" Xref: news.gmane.org gmane.emacs.gnus.user:18422 Archived-At: Eric Abrahamsen wrote: > This has been annoying people for a very long time, but I don't think > there's any clean solution to the problem. Gnus doesn't actually know > that you've suspended and woken your computer, so it doesn't have any > reason to suspect the connections are down. I think we'd have to ping > servers on a timer, or maybe run a clock in lisp and periodically check > it against system time (to see if execution was suspended for a while). > Nothing immediately presents itself as The Right Solution, so no one's > done anything... I guess The Right Solution would be if Emacs would provide access to the operating system's sleep/wake notifications (e.g. on macOS: https://developer.apple.com/library/content/qa/qa1340/_index.html) and tell Gnus about a system wakeup. Gnus could then just close all connections each time it received such a notification. But it doesn't look like there's anything like that in Emacs. The second best thing I can think of is TCP keepalive with much lower values for tcp_keepalive_time and tcp_keepalive_intvl. Gnus actually enables :keepalive in its network sockets (e.g. in nntp.el and nnimap.el), but the default values for the first keepalive package on Linux and Windows is two hours of inactivity, and even then it will take more than 10 minutes of no response until the OS actually closes the connection. It's actually possible to lower the keepalive parameters per socket, but again it doesn't seem like Emacs provides the possibility to do that in elisp. > A lighter-weight solution than a full restart is using "z", for > gnus-group-suspend. That will close all the servers, which will be > re-opened the next time you "g". Weird, pressing "z" in the *Group* buffer just closes Gnus here. Sebastian