NN_INPROC(7)
π 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
- fedora 44: nanomsg-devel 1.2.2-2.fc44 Β· MIT
- fedora 44: nanomsg-devel 1.2.2-2.fc44 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms