[zeromq-dev] IPC (again)

Martin Sustrik sustrik at 250bpm.com
Mon Jan 4 18:46:23 CET 2010

> Hi Martin, erik
> personally i quite like the idea of using a shared named pipe, then
> passing the the fd.

Yes, that's the simplest option. It requires some investigation whether
passing a descriptor via unix domain socket is guaranteed to be atomic.
If not so, data for multiple file descriptors passed through the socket
can be interleaved resulting in a nasty mess.

> the reason for that is if you are going to do communication over pipes, then
> it might be reasonable to assume the app is not doing tcp at all.....

That's a good idea. We can even introduce a new configure option
--with-tcp so that TCP support can be turned off altogether making the
binary smaller.

On the other hand, IPC can be implemented as an optimisation of TCP
transport (thus tcp:// would be automatically passed via a

The former option feels somewhat neater IMO.

> on solaris there is an ioctl for passing the FD between processes, or we
> could use more portable posix code (probabky better).

Stevens suggests using sendmsg, sending the file descriptor as ancillary
data of SCM_RIGHTS type.


More information about the zeromq-dev mailing list