unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Helmut Eller <helmut@xaital.km4u.net>
Cc: emacs-devel@gnu.org
Subject: Re: Feature suggestion: server sockets
Date: Tue, 19 Feb 2002 22:33:02 +0100	[thread overview]
Message-ID: <200202192133.WAA21865@xaital.online-marketwatch.com> (raw)
In-Reply-To: <200202190636.g1J6aig15593@santafe.santafe.edu> (message from Richard Stallman on Mon, 18 Feb 2002 23:36:44 -0700 (MST))


rms@gnu.org wrote:

> This is a useful feature, and a clean Lisp interface.
> I see a couple of possible gaps in the implementation, though.
> 
> Doing this from Emacs itself is cleaner than running an actual
> subprocess like emacsserver to do the job.  But the subprocess runs
> all the time, in parallel with Emacs, while this code seems to be able
> to accept a server connection only inside wait_reading_process_input.
> If Emacs is running a Lisp program for a long time, it may go for a
> long time without ever calling wait_reading_process_input.  This could
> conceivably mean that Emacs takes too long to respond and the request
> fails.
> 
> Can you make connection acceptance happen in response to a signal
> such as SIGIO, or make it happen in an alarm that happens frequently?
> (Such as the one used to poll for available terminal input.)
> The actual running of the filter function would have to wait until
> wait_reading_process_input, of course.  Something like this already
> happens with sentinels, I recall.

I think this is not necessary.  Connection requests are queued by the
OS; accept just takes the first established connection out of the
queue.  A request only fails if the queue is already full.

> One other point: this seems to be designed to work with PF_INET
> sockets only.  If you look at emacsclient, you'll see it uses either a
> PF_UNIX socket or SYSVIPC.  To make server sockets replace
> emacsserver, they would have to support both PF_UNIX sockets and
> SYSVIPC (unless SYSVIPC is obsolete nowadays and all systems support
> sockets).

I modified the code to work with Unix domain sockets.
open-server-socket takes now 3 arguments: NAME, PROTOCOL and
PORT-OR-PATHNAME.  Protocol is either 'inet or 'unix.

Supporting SYSVIPC would be a lot of work, because SYSVIPC uses a
different API, e.g. msgrcv/msgsnd where sockets use read/write.  I
think SYSVIPC is not worth the trouble.

Helmut.
 


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


  reply	other threads:[~2002-02-19 21:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200202162352.AAA23847@xaital.online-marketwatch.com>
2002-02-18 15:10 ` Feature suggestion: server sockets Kim F. Storm
2002-02-18 18:26   ` Helmut Eller
2002-02-19  6:36 ` Richard Stallman
2002-02-19 21:33   ` Helmut Eller [this message]
2002-02-20 22:13     ` Richard Stallman
2002-02-20 22:33       ` Helmut Eller
2002-02-20 22:13     ` Richard Stallman
2002-02-20 23:53       ` Helmut Eller

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=200202192133.WAA21865@xaital.online-marketwatch.com \
    --to=helmut@xaital.km4u.net \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

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

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 read-only IMAP folder(s) and NNTP newsgroup(s).