all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: emacs-devel@gnu.org
Cc: Stefan Kangas <stefankangas@gmail.com>
Subject: Re: master 6a19f2a024: Add new --timeout flag to emacsclient
Date: Tue, 06 Sep 2022 17:18:06 +0200	[thread overview]
Message-ID: <8735d4cz0x.fsf@gmail.com> (raw)
In-Reply-To: <20220906000545.2DD42C0088A@vcs2.savannah.gnu.org> (Stefan Kangas's message of "Mon, 5 Sep 2022 20:05:44 -0400 (EDT)")

>>>>> On Mon,  5 Sep 2022 20:05:44 -0400 (EDT), Stefan Kangas <stefankangas@gmail.com> said:
    Stefan>        do
    Stefan>  	{
    Stefan>  	  act_on_signals (emacs_socket);
    Stefan>  	  rl = recv (emacs_socket, string, BUFSIZ, 0);
    Stefan> +	  retry = check_socket_timeout (rl);
    Stefan> +	  if (retry)
    Stefan> +	    {
    Stefan> +	      if (timeout > 0 && !saw_response)
    Stefan> +		{
    Stefan> +		  /* Don't retry if we were given a --timeout flag.  */
    Stefan> +		  fprintf (stderr, "\nServer not responding; timed out after %lu seconds",
    Stefan> +			   timeout);
    Stefan> +		  retry = false;
    Stefan> +		}
    Stefan> +	      else if (!msg_showed)
    Stefan> +		{
    Stefan> +		  msg_showed = true;
    Stefan> +		  fprintf (stderr, "\nServer not responding; use Ctrl+C to break");
    Stefan> +		}
    Stefan> +	    }
    Stefan>  	}
    Stefan> -      while (rl < 0 && errno == EINTR);
    Stefan> +      while ((rl < 0 && errno == EINTR) || retry);
 
    Stefan>        if (rl <= 0)
    Stefan>          break;
 
    Stefan> +      if (msg_showed)
    Stefan> +	fprintf (stderr, "\nGot response from server");

Iʼm not sure we want to be writing to stderr every time we get a
message from the server after weʼve timed out on the initial recv.

    Stefan> +      saw_response = true;
    Stefan>        string[rl] = '\0';
 
    Stefan>        /* Loop over all NL-terminated messages.  */



Robert
-- 



       reply	other threads:[~2022-09-06 15:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <166242274473.18552.15183774163383733253@vcs2.savannah.gnu.org>
     [not found] ` <20220906000545.2DD42C0088A@vcs2.savannah.gnu.org>
2022-09-06 15:18   ` Robert Pluim [this message]
2022-09-06 21:37     ` master 6a19f2a024: Add new --timeout flag to emacsclient Stefan Kangas
2022-09-07  7:12       ` Andreas Schwab

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=8735d4cz0x.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=stefankangas@gmail.com \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.