Gnus development mailing list
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Tim Landscheidt <tim@tim-landscheidt.de>
Cc: ding@gnus.org
Subject: Re: Constantly having to use `^' for server buffer to close then open server
Date: Thu, 01 Oct 2020 09:02:00 -0700	[thread overview]
Message-ID: <87wo0a5407.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87a6x656jy.fsf@passepartout.tim-landscheidt.de> (Tim Landscheidt's message of "Thu, 01 Oct 2020 15:06:57 +0000")

Tim Landscheidt <tim@tim-landscheidt.de> writes:

> Harry Putnam <reader@newsguy.com> wrote:
>
>> […]
>
>> Go to server buffer (`^') find the server. It appears normal and
>> running.  But I have to click `C' to close it, then `O' to open it.
>> The opening part usually takes 10-15 seconds. Then I can go back to
>> newsgroup and send my message (if I hurry).  If I decide another
>> messages is in order then the same process has to be done again.
>
>> […]
>
>> Seems there might be a bit of code I could call instead of going thru
>> the steps in server buffer.
>
>> Or maybe something more direct to server to keep it alive.
>
>> Hopefully the cause is some user idiocy or other that can be fixed.
>
> I know the pain :-) (but it has not been that much of a
> problem for more in the recent past).  One minor improve-
> ment: You do not have to open the server again (with O);
> Gnus will do that automatically.  Also there is M-c to close
> all servers (which, again, is benign as Gnus will automati-
> cally open those that it needs to).

Over here, M-c is bound to `gnus-group-clear-data', which is a bit of a
dangerous function!

I think this has been a perennial problem for all of us. I recently
added some dbus-related code so that, if you're using a laptop and
putting it to sleep, Gnus will close all its servers first, so they get
re-opened when the machine wakes.

That's not quite the same problem, obviously. I know of two solutions,
neither of them perfect. The first is to manually close the server(s)
when you suspect they've been open too long. I've gotten in the habit of
hitting "z" (gnus-group-suspend) when I haven't touched Gnus for a
while.

Suspend also clears out windows, which might be overkill. Really all
that's necessary is this bit of code:

(dolist (elem gnus-opened-servers)
  (gnus-close-server (car elem)))

Or, probably:

(gnus-close-server '(nntp "news.gmane.io"))

The other solution is to set `nntp-connection-timeout' to a number of
seconds. When you try to connect to the server and get no response
before those number of seconds, Gnus signals `quit'. This isn't great
because 1) you have to wait for the timeout even when it's obvious the
connection is dead, and 2) the quit interrupts everything you're doing.
It would be better if it gave you a message and skipped the operation,
or even better, restarted the operation.

NNTP doesn't support any kind of keepalive/ack protocol, from what I
gather, so the only other solution would probably be to start a timer
from the last successful command response, and then just silently close
the connection when the timer is up. 

> I never researched whether one could (or should) call
> gnus-server-close-all-servers from outside the *Server*
> buffer.

From a brief look at the code, it seems like it ought to work. I've
never tried it either, though.

Eric


  reply	other threads:[~2020-10-01 16:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-01 13:07 Harry Putnam
2020-10-01 15:06 ` Tim Landscheidt
2020-10-01 16:02   ` Eric Abrahamsen [this message]
2020-10-01 17:40     ` Adam Sjøgren
2020-10-01 18:08       ` Eric Abrahamsen
2020-10-01 18:22         ` Adam Sjøgren
2020-10-01 17:43 ` James Cloos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wo0a5407.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=ding@gnus.org \
    --cc=tim@tim-landscheidt.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).