Re: IPC from series of processes to single async process networking process



"Mr. Uh Clem" <uhclem@xxxxxxxxxxxxxxxxxx> writes:

[ description of problem deleted ]


So, after all that intro, my question is about how best to do the
IPC between the (sequence of) com process(es) and the CM process.
This feels like a job for named pipes or unix domain sockets. (I've
used neither before.) The main concern is how a com process will
atomically determine whether the CM process is (still) running.
Seems like there is a race condition if the CM process is exiting
just as a new com process fires off.

This is easy. You could use an AF_UNIX SOCK_STREAM. The com process
would try to connect to a 'well known address' and this connect should
only succeed after the CM process has accepted the connection (and you
will get an error or a SIGPIPE if you wrote to a stream-socket whose
other end has gone away). But you will need to serialize multiple
com processes trying to start a CM process concurrently. That could be
done by using a lockfile, preferably with actual record or file
locking.
.



Relevant Pages

  • Re: what type of socket should I use?
    ... Essentially the server just waits till it gets a message ... | from the client and on reciept of a message it send ... sockets, Named Pipes, or Shared Memory ... Unix Domain Sockets is similar to Named Pipes. ...
    (comp.os.linux.networking)
  • Re: what type of socket should I use?
    ... Essentially the server just waits till it gets a message ... | from the client and on reciept of a message it send ... sockets, Named Pipes, or Shared Memory ... Unix Domain Sockets is similar to Named Pipes. ...
    (comp.os.linux.development.apps)
  • Sockets vs. Named Pipes (2)
    ... I'm comparing two IPC ... I want to solve next problem: secure IPC connection to process under system ... firewall administrator configured local firewall to pass all requests ... Does anyone know if the same problem is actual for Named Pipes? ...
    (microsoft.public.security)
  • Sockets vs. Named Pipes (2)
    ... I'm comparing two IPC ... I want to solve next problem: secure IPC connection to process under system ... firewall administrator configured local firewall to pass all requests ... Does anyone know if the same problem is actual for Named Pipes? ...
    (microsoft.public.win2000.security)
  • Re: UFS extended attributes
    ... On Sun, 9 Apr 2006, Duane Whitty wrote: ... including named pipes, sockets, and device files? ... files, directories, named pipes, UNIX domain sockets, and device nodes. ...
    (freebsd-hackers)