all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuri Khan <yuri.v.khan@gmail.com>
To: Thorsten Jolitz <tjolitz@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: How to communicate with a running external process with
Date: Tue, 23 Jul 2013 15:22:31 +0700	[thread overview]
Message-ID: <CAP_d_8VWGqgouEba=YYHZUCi7SEEp3_Sa+Xy0evJSpYYDc=agQ@mail.gmail.com> (raw)
In-Reply-To: <87txjlr9js.fsf@gmail.com>

On Tue, Jul 23, 2013 at 2:59 PM, Thorsten Jolitz <tjolitz@gmail.com> wrote:

> Assume there are 2 otherLisp processes up and running and 2 Emacs
> processes, and you want to communicate from otherLisp with PID 5555 to
> Emacs with PID 6666.

First, decide which program is the server and which is the client. A
server, roughly speaking, is the process that first establishes the
channel of communication — creates a pipe, a Unix socket, or listens
on a TCP port. Clients then have to know the pipe path/filename, the
Unix socket path, or the IP address and TCP port, in order to connect
to the server. Once the connection by client is established, both
server and client have a file descriptor and can communicate just by
writing into it.

If you have two instances of the server, they have to listen on
different pipes, Unix sockets (by path/name), or, in case of TCP, the
<IP address:port> pairs have to be distinct. Thus, the clients will be
able to connect to the server they want, by knowing the specific
server pipe or Unix socket path or IP address and TCP port.

The process ID just never enters the picture. (Although, if you
control the server, you can make up a convention that, e.g., the
server always listens on the Unix socket with the path
/var/run/your_server_name.$PID.)



  reply	other threads:[~2013-07-23  8:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-22 15:27 How to communicate with a running external process with Buchs, Kevin J.
2013-07-23  7:59 ` Thorsten Jolitz
2013-07-23  8:22   ` Yuri Khan [this message]
2013-07-23  9:30     ` Thorsten Jolitz
2013-07-23 19:09   ` Pascal J. Bourguignon
2013-07-23 20:13     ` Thorsten Jolitz
2013-07-23 23:06       ` Pascal J. Bourguignon
2013-07-24  6:34         ` Thorsten Jolitz
     [not found]   ` <mailman.1659.1374606578.12400.help-gnu-emacs@gnu.org>
2013-07-23 19:12     ` Pascal J. Bourguignon
2013-07-23 20:15       ` Thorsten Jolitz
     [not found] ` <mailman.1619.1374566396.12400.help-gnu-emacs@gnu.org>
2013-07-23 14:43   ` Barry Margolin

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='CAP_d_8VWGqgouEba=YYHZUCi7SEEp3_Sa+Xy0evJSpYYDc=agQ@mail.gmail.com' \
    --to=yuri.v.khan@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=tjolitz@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.