I'm looking at creating a class which accepts a string to define a Unix socket address.

Linux supports three types of addresses for Unix sockets:

  1. File based addresses (also called named domain addresses)
  2. Abstract addresses
  3. Unnamed addresses

The first is the conventional method which works on pretty much all Unices.

The second is only available on Linux. It accepts a name of up to 107 characters which is composed of any binary byte. The convention, though, has been to use a Java-like name such as /com/ubuntu/background/file as seen in dbus.

The third is used between parent & child (created by fork() or fork() + exec().) The parent creates two sockets, one for the parent and one for the child and then uses one to read/write and the child uses the other.

We have well defined schemes for things such as http://, ftp://, etc. Are there any such official definitions for AF_UNIX based sockets?

I could foresee something such as:

  • local:///<full-path-to-file>
  • dbus:///<abstract-path>
  • unnamed:


A unix: protocol would work too, but then I could not distinguish between each type supported by Linux with just the protocol.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.