NN_INPROC(7)

πŸ“¦
version 1.2.2 Β· 5 versions
, in fedora 44

πŸ’… NN_INPROC β€” bestie, it's the in-process transport 🧚✨

okay so this is the manual page for nn_inproc, section 7, from nanomsg 1.2.2, and it's literally the glow-up guide to sending messages inside your own process. no network, no sockets leaving the building, just vibes between threads. let's get into it 🫢


🌸 NAME 🌸

nn_inproc β€” the in-process transport mechanism, aka the one that keeps everything in the family πŸ’–


✨ SYNOPSIS ✨

#include <nanomsg/nn.h>

#include <nanomsg/inproc.h>

that's it, that's the whole invitation. two includes and you're in πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

So the in-process transport is exactly what it sounds like: it lets you send messages between threads or modules inside a process. same process, bestie, no travel required βœˆοΈπŸ’€

An in-process address is just an arbitrary case-sensitive string with the inproc:// protocol specifier glued on the front. and the way all in-process addresses are visible from any module within the process? iconic. but lowkey important: they are not visible from outside of the process. so it's giving private group chat, not public broadcast 🌈


now here's the part where we have to be real with each other 😭

The nature of in-process transport makes it easy to pass pointers between threads instead of actual data. and like… yes, it works. but it is considered a bad application design and it violates the scalable share-nothing architecture. not me exposing you to the architecture police 🚨

If you do pass pointers among threads, synchronising thread access to shared data becomes your responsibility. that's on you, babe. no one else is holding that.

and it gets worse β€” such a design also prevents moving the thread into a different process or machine once the need arises. so you've basically locked yourself into one machine forever and the escape hatch is gone πŸ™ˆ

As a rule of the thumb: don't pass pointers among threads unless you know what you are doing. fr fr. if you know, you know. iykyk πŸ’…


πŸŽ€ the buffer tea πŸ“

The overall buffer size for an inproc connection is determined by the NN_RCVBUF socket option, and specifically on the receiving end of the connection. πŸ“₯

The NN_SNDBUF socket option is ignored. sorry to that option, it simply does not get a seat at this table πŸ’€

and here's the cute part: in addition to the buffer, one message of arbitrary size will fit into the buffer. so even messages that are larger than the buffer can be transferred via an inproc connection. slay. the buffer said "i contain multitudes" ✨πŸ”₯


πŸ”₯ EXAMPLE πŸ”₯

nn_bind (s1, "inproc://test");
nn_connect (s2, "inproc://test);

(yes bestie, we are keeping that exactly as written β€” character for character, no touching πŸ‘‘)


🌟 SEE ALSO 🌟


πŸ’œ AUTHORS πŸ’œ

Martin Sustrik <sustrik@250bpm.com> β€” the icon who brought us this whole thing, we stan 🫢


and that's the page, bestie!! this manual dropped 2026-01-16, it's from nanomsg 1.2.2, and it lives in section 7 as NN_INPROC(7). go forth and keep your messages in-process, no cap πŸ’…βœ¨

πŸ“¦ where this page comes from