NNG_IPC_OPTIONS(5)

πŸ“¦
version 1.12.0 Β· 4 versions
, in ubuntu stonking

πŸ’– NNG_IPC_OPTIONS πŸ’–

okay bestie, welcome to the NNG Reference Manual page for nng_ipc_options β€” this is the one that spills all the tea about IPC-specific options πŸ«–βœ¨


🌸 NAME 🌸

nng_ipc_options β€” IPC-specific options πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <nng/nng.h>

#define NNG_OPT_IPC_PEER_GID            "ipc:peer-gid"
#define NNG_OPT_IPC_PEER_PID            "ipc:peer-pid"
#define NNG_OPT_IPC_PEER_UID            "ipc:peer-uid"
#define NNG_OPT_IPC_PEER_ZONEID         "ipc:peer-zoneid"
#define NNG_OPT_IPC_PERMISSIONS         "ipc:permissions"
#define NNG_OPT_IPC_SECURITY_DESCRIPTOR "ipc:security-descriptor"

✨ DESCRIPTION ✨

This page is the master doc for all the standard options you can set or retrieve on objects that use IPC. no cap 🌈

Quick PSA though: always use these option names through their symbolic definitions, bestie. like, don't go typing the raw strings, use the #defines. it's giving manners. πŸ’…

so down below, each option gets its name plus the data type of the value hiding underneath it.

also β€” some of these options only make sense (or are only even supported) in certain contexts, and some come with extra access restrictions. the page tries its best to note those restrictions in each option's description. πŸ’–

Note 🫢 Whether these options even exist is platform-specific, because IPC is implemented very differently on Windows vs POSIX systems. so like, vibe check your platform first.

NNG_OPT_IPC_PERMISSIONS πŸ”

(int) β€” this one is write-only, and you drop it on a listener to configure the permissions used on the UNIX domain socket that listener creates. it's POSIX-only, so Windows besties sit this one out πŸ™ˆ.

the value is an int and it represents the normal permission bits on a file β€” like 0600, which typically means read-write to the owner, and absolutely nothing for anyone else. iconic boundary-setting honestly.

the default is system-specific, and most often it's 0644.

Important ⚠️ not every system actually validates these permissions! specifically, illumos and Solaris are known to just ignore these permission settings when connecting. so don't trust it blindly, bestie.
Note πŸ’œ normally a peer dialer needs both read and write permission to connect. go read your system's documentation for UNIX domain sockets for the full lore.
Note 🌸 the umask of the process is not applied to these bits. nope. not a thing.
Tip πŸ‘‘ the best practice for limiting access is to put the socket in a directory that's writable only by the server, and only readable and searchable by clients. why? because all mainstream POSIX systems will refuse to let a client connect to a socket sitting in a directory where the client lacks search (execute) permission. periodt. that's the gatekeeping our security girlboss deserves. πŸ”₯

NNG_OPT_IPC_SECURITY_DESCRIPTOR πŸͺŸ

(PSECURITY_DESCRIPTOR) β€” also write-only, and this one is for Windows platforms, applied on listeners, to configure the SECURITY_DESCRIPTOR used when creating the underlying named pipe. πŸ¦‹

the value is a pointer, PSECURITY_DESCRIPTOR, and it may only be applied to listeners that have not been started yet. like, once it's running? too late, bestie. πŸ’€


🌈 Common Platform Specific Options 🌈

these are supported by this transport when the underlying platform supports them:

  • NNG_OPT_PEER_GID (also available as NNG_OPT_IPC_PEER_GID) πŸ’–
  • NNG_OPT_PEER_PID (also available as NNG_OPT_IPC_PEER_PID) πŸ’œ
  • NNG_OPT_PEER_UID (also available as NNG_OPT_IPC_PEER_UID) πŸŽ€
  • NNG_OPT_PEER_ZONEID (also available as NNG_OPT_IPC_PEER_ZONEID) ✨

🧚 Inherited Options 🧚

generally, these option values are also available when appropriate for the context:

  • NNG_OPT_LOCADDR πŸ“
  • NNG_OPT_REMADDR ⭐

πŸ”₯ SEE ALSO πŸ”₯

nng_dialer_get(3), nng_dialer_set(3), nng_listener_get(3), nng_listener_set(3), nng_pipe_get(3), nng_options(5) nng(7), nng_ipc(7)


and that's the whole page, bestie!! this was the NNG Reference Manual entry NNG_IPC_OPTIONS(5) β€” dated 2026-06-30. go forth and configure your IPC like the main character you are πŸ’…πŸ’–πŸ¦‹

πŸ“¦ where this page comes from