NNG_IPC(7)

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

πŸ’– NNG_IPC(7) β€” the ipc transport, bestie edition πŸ’–

okay so this is nng_ipc, straight out of the NNG Reference Manual, and it's literally the page that teaches you how two processes on the same host talk to each other. same machine, different processes, no network involved. it's giving "we're both here, let's just chat" energy. 🫢


✨ NAME ✨

nng_ipc β€” the IPC transport πŸŽ€


🌸 SYNOPSIS 🌸

#include <nng/transport/ipc/ipc.h>

int nng_ipc_register(void);

πŸ¦‹ DESCRIPTION πŸ¦‹

so the ipc transport gives you communication support between sockets that live in different processes on the same host. that's the whole vibe. same machine only, no cap.

how it's actually built depends on where you are:

  • on POSIX platforms, it's implemented with UNIX domain sockets
  • on Windows, it's implemented with Windows Named Pipes
  • other platforms? they may have different implementation strategies. totally valid. πŸ’…

πŸŽ€ Registration πŸŽ€

good news bestie β€” this transport is generally built-in to the core, so you shouldn't need to do any extra steps to use it. it just works. iconic. ✨


🌈 URI Formats 🌈

πŸ’œ Traditional Names πŸ’œ

this transport uses URIs with the scheme ipc://, followed by a path name in the file system where the socket or named pipe should be created.

Tip πŸ’‘ On Windows, all names are prefixed by \\.\pipe\ and do not reside in the normal file system. On POSIX platforms, the path is taken literally, and it's relative to the current directory β€” unless it begins with /, in which case it's relative to the root directory.
Note πŸ“Œ When you use relative paths on POSIX systems, the address used and returned in properties like NNG_OPT_LOCADDR and NNG_OPT_URL will also be relative. which means they'll only be interpreted the same way by processes that have the same working directory. so to keep things maximum portable and safe, absolute paths are recommended whenever possible. fr fr.
Note πŸ“Œ If you need compatibility with legacy nanomsg applications, then path names must not be longer than 122 bytes, including the final NUL byte. why? because legacy versions of nanomsg cannot express URLs longer than 128 bytes, including the ipc:// prefix. that's the limit, babes, that's just how it is. 😭

🧚 UNIX Aliases 🧚

the unix:// scheme is an alias for ipc:// and can be used inter-changeably β€” but only on POSIX systems. πŸ’«

the purpose of this scheme is to support a future transport making use of AF_UNIX on Windows systems, at which time it'll be necessary to discriminate between the Named Pipes transport and the AF_UNIX based transport. planning ahead, we love to see it. πŸ‘‘

⭐ Abstract Names ⭐

on Linux, this transport also supports abstract sockets. abstract sockets use a URI-encoded name after the scheme, which lets arbitrary values be conveyed in the path β€” including embedded NUL bytes. for example, the name "a\0b" would be represented as abstract://a%00b. encoding? slayed. πŸ”₯

Tip πŸ’‘ an empty name may be used with a listener to request "auto bind" be used to select a name. in that case the system will allocate a free name. the name assigned may be retrieved using NNG_OPT_LOCADDR. cute, right?
Note πŸ“Œ NNG cannot represent an abstract socket with the empty name.
Note πŸ“Œ abstract names do not include the leading NUL byte used in the low-level socket address.

abstract sockets do not have any representation in the file system, and are automatically freed by the system when no longer in use. they also ignore socket permissions β€” but you can still determine the credentials of the peer with NNG_OPT_PEER_UID, etc. so you still know who you're talking to. πŸ‘€

πŸ“ Socket Address πŸ“

when you're using an nng_sockaddr structure, the actual structure is of type nng_sockaddr_ipc β€” except for abstract sockets, which use nng_sockaddr_abstract. know the difference, iykyk. πŸ’…


πŸ‘‘ Transport Options πŸ‘‘

the following transport options are supported by this transport, where supported by the underlying platform:

  • NNG_OPT_IPC_PERMISSIONS
  • NNG_OPT_IPC_SECURITY_DESCRIPTOR
  • NNG_OPT_LOCADDR
  • NNG_OPT_REMADDR
  • NNG_OPT_PEER_GID
  • NNG_OPT_PEER_PID
  • NNG_OPT_PEER_UID
  • NNG_OPT_PEER_ZONEID
  • NNG_OPT_URL

πŸ’« SEE ALSO πŸ’«

nng_sockaddr(5), nng_ipc_options(5), nng_options(5), nng(7)


and that's the whole page bestie, no notes, we ate. this was the NNG Reference Manual, NNG_IPC(7), dated 2026-06-30 β€” go forth and IPC responsibly. mwah. πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from