[zeromq-dev] zmq and abstract unix domain sockets

Martin Sustrik sustrik at 250bpm.com
Wed Dec 8 09:21:07 CET 2010

Hi Moritz,

> The problem is that abstract unix domain sockets of the style
> "\0mysocketname" are accepted, but not handled correctly. I posted some
> example here: http://paste.pocoo.org/show/300124/
> There are three options how to handle that:
> 1. There's no problem. There should be a valid path given for a unix
> domain socket and if you do something else you're on your own. Then that
> should be documented.
> 2. Throw a readable error if someone tries to use an abstract unix
> domain socket.
> 3. Support abstract unix domain sockets through they are only valid in
> GNU/Linux systems.
> I think #1 is a bad style, #2 would be ok and #3 is the hyper über cool
> solution zmq stands for.

I think the primary question to ask is: Do we want to strive for 
portability on 0MQ-API level or rather do we want to expose useful 
non-portable hacks?

Both views have their merit of course and it's not obvious which 
direction to take.

Similar problem is resolving the NIC names. These are different on 
different OSes (eth0, en0, e1000g etc.) but auto-resolve is kind of 
convenient. Still, I've seen people arguing that raw IP addresses should 
be used instead.

That's the conceptual problem -- it would be interesting to know what 
are the opinions on it.

 From technical point of view, using \0-prefixed paths is a problem with 
current API as the connection string passed to both zmq_connect and 
zmq_bind in standard C zero-terminated string. Thus, the \0 character in 
the connection string effectively terminates it.

We could switch to standard POSIX-style addresses -- addr_zmq structure 
containing fixed buffer and length -- however, that is an backward 
incompatible change and cannot be done before major version number bump 


More information about the zeromq-dev mailing list