NNG_DIALER(5)
π NAME π
nng_dialer β bestie it's literally the dialer, the outgoing-connection icon herself β¨
π SYNOPSIS π
#include <nng/nng.h>
typedef struct nng_dialer_s nng_dialer;
π¦ DESCRIPTION π¦
Okay so an nng_dialer is a handle to a dialer object, and her whole job β her entire main character moment β is creating a single nng_pipe at a time by establishing an outgoing connection. One at a time. She's methodical like that. π
And if that connection breaks, or fails entirely? She does not give up. The dialer object will automatically attempt to reconnect, and will keep doing so until the dialer or the socket is destroyed. Persistence queen behavior fr fr. π₯
Dialer objects get created by the nng_dialer_create() or nng_dial() functions, and they're always associated with a single nng_socket. Like, always always. No polyamory with sockets here, she's loyal. π«Ά
β οΈ Important β the nng_dialer structure is always passed by value, both for input parameters and return values, and you should treat it opaquely (no peeking inside, bestie, it's giving mystery β¨). Passing structures this way gives the compiler a chance to perform accurate type checks in functions passing values of this type. So like, respect the privacy and the compiler will have your back.
π‘ Tip β a given nng_socket may have multiple dialer objects, multiple listener objects, or even some of both. She contains multitudes, honestly.
π‘ Tip β the client/server relationship described by dialer/listener is completely orthogonal to any similar relationship in the protocols. For example, arepsocket may use a dialer to connect to a listener on anreqsocket. And the way that this orthogonality can lead to innovative solutions to otherwise challenging communications problems?? Chef's kiss. ππ
Dialer objects may be destroyed by the nng_dialer_close() function. They are also closed when their associated socket is closed β when one goes, they all go, ride or die. π
πΈ Initialization πΈ
A dialer may be initialized using the macro NNG_DIALER_INITIALIZER before it is opened, to prevent confusion with valid open dialers. Basically: mark her as "not open yet" so nobody gets her confused with a dialer who's actually out there living her life. π
π SEE ALSO π
nng_dial(3)nng_dialer_close(3)nng_dialer_create(3)nng_dialer_getopt(3)nng_dialer_id(3)nng_dialer_setopt(3)nng_dialer_start(3)nng_listener(5)nng_pipe(5)nng_socket(5)nng(7)
and that's the whole vibe, bestie π go forth and dial responsibly β¨π¦
NNG Reference Manual β page NNG_DIALER(5), dated 2026-06-30 π she's iconic, she's periodt, she's canon π
π¦ 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