NNG_SOCKADDR_ABSTRACT(5)
π NNG_SOCKADDR_ABSTRACT(5) π
okay bestie, welcome to the NNG Reference Manual corner of the internet, where today we're decoding nng_sockaddr_abstract β literally the abstract IPC socket address glow-up β¨
πΈ NAME πΈ
nng_sockaddr_abstract β the abstract IPC socket address, but make it a vibe π
β¨ 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 π¦
So. An nng_sockaddr_abstract is the specific flavor of nng_sockaddr that represents addresses tied to IPC communication over "abstract" sockets. It's giving niche, it's giving Linux-only, it's giving exactly what you need when you need it π«Ά
π Linux only, sorry bestie
Abstract sockets? Only supported on Linux at this point in time. No cap.
Their name is just a plain array of bytes β zero special meaning attached, no hidden rules, just bytes being bytes π
Also, and this is the iconically unbothered part:
- They have no presence in the file system π
- They do not honor any permissions
- The operating system automatically cleans them up when nobody's using them anymore
β οΈ Note: support for abstract sockets is a new feature in NNG, and it's only available on Linux. Because of that, using them is not recommended for portable applications β your code will be sad on other platforms π
π The struct members (the actual tea)
sa_familyβ this field always has the valueNNG_AF_ABSTRACT. Always. It's loyal like that πsa_lenβ this field provides the length of the name stored insa_namesa_nameβ this field holds the name of the abstract socket. The bytes of the name can be any value, including zero β
π Note: the name does not include the leading NUL byte that Linux uses to tell abstract sockets apart from path name sockets.
π₯ Auto Bind π₯
Main character feature alert: you can pass an empty value β that's sa_len equal to zero β on a listening socket to ask the system to allocate a name for you β¨
On Linux systems, that gets you a name with either 5 or 8 hexadecimal ASCII characters. Cute, right?
Wanna know which name the system picked for you? Just grab the NNG_OPT_LOCADDR option on the listening entity π
β οΈ Note: since a zero length name is what signals "please auto bind for me", it is impossible to specify an actual empty name. NNG does not support that name, even though the underlying system can support it. And honestly? Using that name is inadvisable anyway π
π SEE ALSO π
that's the whole page bestie, you ate it π consider yourself fully briefed on abstract sockets, no notes, periodt π
this masterpiece of a manpage is from the NNG Reference Manual, dated 2026-06-30, and it lives under the name NNG_SOCKADDR_ABSTRACT(5) β iconic, honestly π
π¦ where this page comes from
- ubuntu stonking: libnng-dev 1.12.0-1 Β· MIT OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms