table of contents
NNG_SOCKADDR_ABSTRACT(5) | NNG Reference Manual | 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
sa_len
sa_name
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¶
2025-02-02 |