From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 28970 invoked from network); 4 May 2020 17:22:09 -0000 Received: from lists1.math.uh.edu (129.7.128.208) by inbox.vuxu.org with ESMTPUTF8; 4 May 2020 17:22:09 -0000 Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.92.3) (envelope-from ) id 1jVema-0007um-KB; Mon, 04 May 2020 12:21:32 -0500 Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1jVemW-0007s2-5v for ding@lists.math.uh.edu; Mon, 04 May 2020 12:21:28 -0500 Received: from quimby.gnus.org ([95.216.78.240]) by mx2.math.uh.edu with esmtps (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1jVemU-0002Un-Lb for ding@lists.math.uh.edu; Mon, 04 May 2020 12:21:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=z4Rud8hyuQfxgEaSHL3Xag+O4Q+hP/Az+TERF+pQs9o=; b=JLMgQ0GDxfbqBQz4dt6jx05Y4I VdD8sjZeQNbcz9sn7xfN6rKV6v3guhu8AtIo6l6W+G3WQB9WmqZpr8kZfHcGrrPv45MyKN7vkPOCo iIhfvwlJ32zeO6P3V/vQpb1DU9qe0pQbiWh1kGUrcaBkkDQwuakL+lHM02xD8Poa6T/g=; Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by quimby.gnus.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jVemN-0002UK-LJ; Mon, 04 May 2020 19:21:22 +0200 Received: by mail-wr1-x42a.google.com with SMTP id i10so21903578wrv.10; Mon, 04 May 2020 10:21:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:gmane-reply-to-list:date:in-reply-to :message-id:mime-version; bh=z4Rud8hyuQfxgEaSHL3Xag+O4Q+hP/Az+TERF+pQs9o=; b=ZtpSTBh/mTwYCQypUOcA32ON4SUgzz2V5h5k/vAtU4+uR2MRK0oGoY8G5wVJnp4MNW at1ZK+tBzTUglo623xCquGKaooXKQR66hk41iHW8z8YaBeD/gUXjrabMytTOzARHOdLa mPc0GWTu9taBucA3aNjcoMZL9cgi6tOx07k3cwjiKWQTsSHg7Kzmiby8lmV36ueuBLel Bj5RnVFucziPZGdRL9AN1D+019Z9w9HyCyAs69OSzxEbxPWBNKWJPGTLbZDE98yw+xqn jj6uV+FZ1612ZAlcayTavWUipug5KGPH+OzyJtnX4KCwb3QUC4ko8WhfCDWa0X1jpwfc cj9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references :gmane-reply-to-list:date:in-reply-to:message-id:mime-version; bh=z4Rud8hyuQfxgEaSHL3Xag+O4Q+hP/Az+TERF+pQs9o=; b=puqZcdDz73DBhZn7qHGeLamQcjBXZ5NPDqAd6Pr+sSfAWbkUv9qgQEb0lq+K9sLsmH J5RtOCoHO4rN+6HSF3sl+OUp1ZNRARbLvC3axTb8591oI078nMfdGaE/kZoyF1fUdFbL W4Im2v8r4J5RfqbR6Gy4WUhmOfJYt4u8GczlGIwguScy0yC5KTaZ24kRUaQbICfWBB/p jfj2cVl/om/D1QMBNwL7gvQhgHwfsZq38l9gaYjxsZDxruAn7b5gLUMG0ZWIBZBQOfSf PcQMRSeRyzj1KfR1eDvdXwNn9srRU855DBqTKivJmnssKNs1g6V/CCxXkcsnUs7I4cup WHeg== X-Gm-Message-State: AGi0PuY9nc8hFaoI/M7TI2081GVUmkp1yOagAKSoAtxvCowcJRO1ouPH GR0PwuLH17cM7xnGtZdXmXW19szn+i8= X-Google-Smtp-Source: APiQypJuNAGsSi0yu7MlvGVykaBqCNnlPABzg9gNvGlcVRHoxzmqNuzyv5KqJf45oNJ0lpTnKUuzkA== X-Received: by 2002:adf:ca0e:: with SMTP id o14mr391582wrh.254.1588612877928; Mon, 04 May 2020 10:21:17 -0700 (PDT) Received: from rpluim-mac ([2a01:e34:ecfc:a860:194a:31ec:fdb9:4df5]) by smtp.gmail.com with ESMTPSA id h2sm102503wmf.34.2020.05.04.10.21.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2020 10:21:17 -0700 (PDT) From: Robert Pluim To: Eric Abrahamsen Cc: Lars Ingebrigtsen , Christian Barthel , ding@gnus.org Subject: Re: new wifi connection = nntp timeout = Emacs restart? References: <87sgh3coxn.fsf@ericabrahamsen.net> <87o8rogew7.fsf@barthel.ch> <87zhb7mlf0.fsf@ericabrahamsen.net> <87a72t35ng.fsf@gnus.org> <87wo5wev3m.fsf@ericabrahamsen.net> <878sic1w65.fsf@gnus.org> <87y2qcbp45.fsf@ericabrahamsen.net> <87pnbjwy5y.fsf@gnus.org> <874ksvodwm.fsf@ericabrahamsen.net> Gmane-Reply-To-List: yes Date: Mon, 04 May 2020 19:21:15 +0200 In-Reply-To: <874ksvodwm.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Mon, 04 May 2020 09:36:41 -0700") Message-ID: MIME-Version: 1.0 Content-Type: text/plain List-ID: Precedence: bulk >>>>> On Mon, 04 May 2020 09:36:41 -0700, Eric Abrahamsen said: >> Eric, are you on GNU/Linux? I can cook up a patch for that platform to >> try if you want. Eric> Yes, I'm on arch linux. I'd be happy to try this out. I'll be switching Eric> networks later this morning, if you've got something on hand already! Be prepared for rather more network traffic when Gnus is idle. diff --git a/src/process.c b/src/process.c index 6e5bcf307a..fb0a20c797 100644 --- a/src/process.c +++ b/src/process.c @@ -38,6 +38,7 @@ Copyright (C) 1985-1988, 1993-1996, 1998-1999, 2001-2020 Free Software #include #include #include +#include #include #endif /* subprocesses */ @@ -3456,6 +3457,27 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos, optbits |= set_socket_option (s, key, val); } } + if (!p->is_server && p->socktype != SOCK_DGRAM) + { + int optval; + int sz = sizeof(optval); + /* Enable keepalive. */ + optval = 1; + if (setsockopt (s, SOL_SOCKET, SO_KEEPALIVE, &optval, sz)) + report_file_error ("socket keepalive 1", Qnil); + /* Set idle time. */ + optval = 1; + if (setsockopt (s, IPPROTO_TCP, TCP_KEEPIDLE, &optval, sz)) + report_file_error ("socket keepalive 2", Qnil); + /* Time between keepalives. */ + optval = 1; + if (setsockopt (s, IPPROTO_TCP, TCP_KEEPINTVL, &optval, sz)) + report_file_error ("socket keepalive 3", Qnil); + /* Number of probes. */ + optval = 2; + if (setsockopt (s, IPPROTO_TCP, TCP_KEEPCNT, &optval, sz)) + report_file_error ("socket keepalive 4", Qnil); + } if (p->is_server) {