[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Back to emacsclient/server
From: |
Juanma Barranquero |
Subject: |
Back to emacsclient/server |
Date: |
Mon, 23 Oct 2006 16:14:20 +0200 |
I'm finally getting the time to try implementing TCP sockets (and so
Win32 support) for emacsclient.c/server.el. I must confess that the
talk about reimplementing gnuserv in Java has made me shiver quite a
lot (no offense intended, I just happen to not like Java *at all*).
I've reviewed all comments exchanged about this issue in past threads
(or at least all the ones I could find). There were some decisions
that got more-or-less universal agreement, some that were
controversial, and a few that were left undecided (mostly because we
were throwing ideas back and forth).
So let's recapitulate:
- The server (i.e., server.el) should:
- Have an option to choose among Unix (if available) or TCP sockets.
- Have an option to specify the host address, defaulting to 127.0.0.1.
- Choose the port at random (to allow multiple server in the same computer).
- Write the hostname address, port and random authentication string
in a file.
- Close any connection which doesn't start with "-auth
AUTHENTICATION-STRING".
- The client (emasclient.c) should:
- Interpret --server-name as an Unix socket (if available), and, if
that does fail, as a path to the server file.
- Default --server-name to an environment variable
(EMACS_SERVER_NAME, for example), if -server-name is missing.
- Send "-auth AUTHENTICATION-STRING" as the first command in any connection.
There was some discussion about allowing/not allowing remote
connections (defaulting to "not allow"). If they're allowed, either a
option in server.el would activate remote connection support, or
perhaps just the fact that server-host != 127.0.0.1 should suffice. I
favor this, because connections on Unix sockets will never be remote,
so a new option seems redundant. But I don't care much.
Stefan wanted that --server-name=foo, if not valid as a Unix socket,
would try to open server file ~/.emacs.server/foo to get the address,
port and authentication string. I'm not so sure. I don't see why root
in one session cannot try to connect with Emacs in another user's
session, so --server-name is gonna need to be a (relative or absolute)
path, and not a name depending of the current user. Am I missing
something?
The last time around, about 80% of the above was implemented; I'll
have to rework it because I got rid of the Unix socket support (which
must stay), but it shouldn't be too difficult.
--
/L/e/k/t/u