NNG_SOCKADDR_ABSTRACT(5)

NAME
nng_sockaddr_abstract - abstract IPC socket address

SYNOPSIS

    #include <nng/nng.h>
    enum sockaddr_family {
        NNG_AF_ABSTRACT = 6,
    };
    typedef struct {
        uint16_t sa_family;
        uint16_t sa_len;
        char     sa_name[107];
    } nng_sockaddr_abstract;

DESCRIPTION

 An nng_sockaddr_abstract is the flavor of nng_sockaddr used to represent addresses associated with IPC communication using “abstract” sockets.

Abstract sockets are only supported on Linux at present. These sockets have a name that is simply an array of bytes, with no special meaning. Abstract sockets also have no presence in the file system, do not honor any permissions, and are automatically cleaned up by the operating system when no longer in use.

    Note

    Support for abstract sockets is a new feature in NNG, and it is only available on Linux. As such their use is not recommended for portable applications.

The following structure members are present:

sa_family
    This field will always have the value NNG_AF_ABSTRACT.

sa_len
    This field provides the name of the length stored in sa_name.

sa_name
    This field holds the name of the abstract socket. The bytes of name can have any value, including zero.

    Note

    The name does not include the leading NUL byte used on Linux to discriminate between abstract and path name sockets.

  Auto Bind

An empty value (sa_len equal to zero) can be used on listening sockets to request the system allocate a name. On Linux systems, this will result in a name with either 5 or 8 hexadecimal ASCII characters. The name chosen can be obtained by retrieving the NNG_OPT_LOCADDR option on the listening entity.

    Note

    Because a zero length name is used to indicate auto bind be used, it is impossible to specify an actual empty name. This name are not supported by NNG, although the underlying system can support it. The use of that name is inadvisable anyway.

SEE ALSO

nng_sockaddr(5), nng_ipc(7) nng(7)