NNG_STREAM_DIALER_ALLOC(3str)
β¨ NNG_STREAM_DIALER_ALLOC(3str) β¨
okay so this is from the NNG Reference Manual bestie, page NNG_STREAM_DIALER_ALLOC(3str) β and it's literally all about making a dialer for byte streams π
πΈ NAME πΈ
nng_stream_dialer_alloc β allocate a byte stream dialer π¦
π SYNOPSIS π
#include <nng/nng.h>
int nng_stream_dialer_alloc(nng_stream_dialer **dp, const char *addr);
int nng_stream_dialer_alloc_url(nng_stream_dialer **dp, const nng_url *url);
β¨ DESCRIPTION β¨
So these functions allocate a dialer for byte streams, no cap. And a dialer's whole thing β its whole main character energy β is making nng_stream objects by initiating outgoing connections, via the nng_stream_dialer_dial() function. π«Ά
The first form, nng_stream_dialer_alloc(), connects to the address specified by addr, which should be a string representing a URL. simple as that π
The second form, nng_stream_dialer_alloc_url(), takes a pre-parsed or pre-constructed nng_url object to determine the remote address. like, you already did the parsing, slay π
These functions may support different URL schemes, such as ipc://, tcp://, tls+tcp://, or ws://. lowkey iconic that they're flexible like that π
Both forms store the dialer in the location referenced by dp. don't forget your pointer-to-pointer, bestie π
π RETURN VALUES π
These functions return 0 on success, and non-zero otherwise. that's the vibe check β zero is good, anything else means something went sideways π
π ERRORS π
NNG_ENOMEMβ Insufficient free memory exists. your machine said "I have nothing left to give" fr fr πNNG_ENOTSUPβ The URL scheme is not supported by the implementation. this implementation looked at your scheme and was like, not today π«NNG_EADDRINVALβ The URL requested is invalid. the address you handed over did not pass inspection, ngl π
π¦ SEE ALSO π¦
nng_strerror(3)nng_stream_dialer_close(3str)nng_stream_dialer_dial(3str)nng_stream_dialer_free(3str)nng_stream_dialer_get(3str)nng_stream_dialer_set(3str)nng_stream_dialer(5)
go read those next, iykyk πβ¨
okay that's the whole page, bestie β mwah π this one dropped 2026-01-13 from the NNG Reference Manual and it's filed under NNG_STREAM_DIALER_ALLOC(3str). go forth and dial responsibly ππ¦π
π¦ where this page comes from
- alpine 3.24: nng-doc 1.11-r0 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms