NNG_STREAM_DIALER_DIAL(3str)
π NNG_STREAM_DIALER_DIAL β¨
okay bestie, so this is a page from the NNG Reference Manual β specifically NNG_STREAM_DIALER_DIAL(3str), the 3str section, iykyk. Let's get into it π
πΈ NAME πΈ
nng_stream_dialer_dial β initiate outgoing byte stream connection
Like, you're the one sliding into the server's DMs. Outgoing. You're making the call π
β¨ SYNOPSIS β¨
#include <nng/nng.h>
void nng_stream_dialer_dial(nng_stream_dialer *d, nng_aio *aio);
Two args, no return value, no drama. We love a low-maintenance signature π«Ά
π¦ DESCRIPTION π¦
So nng_stream_dialer_dial() is out here attempting to establish a connection to the remote peer for the dialer d. And the way it does this is asynchronous β the operation gets completed using aio, so nobody's standing around blocking. Main character energy, honestly β
Tip π β the peer address? it's determined by the address you specified usingnng_stream_dialer_alloc()ornng_stream_dialer_alloc_url(). So like, the address was decided way before this function even showed up. It's giving "the outfit was planned the night before" π
And if the connection is successfully established, the aio will have the resulting nng_stream object stored as its first output. (Check it with nng_aio_get_output().) Literally the payoff moment π
π₯ RETURN VALUES π₯
None. Nothing. Nada. It returns void, bestie β the good stuff shows up in the aio, not in a return value π
π ERRORS π
when things go wrong (and they do, no cap), you might see:
NNG_EADDRINVALβ the address specified is invalid. not a real address, girl πNNG_ECANCELEDβ the operation was aborted. it got cancelled mid-vibe.NNG_ECLOSEDβ the dialer is closed. door's shut, gone, not answering πNNG_ECONNREFUSEDβ the connection was refused by the server. left on read, fr fr πNNG_ECONNRESETβ the connection was reset by the server. it was going so well and then poof πNNG_ENOMEMβ insufficient free memory exists. brain full, cannot compute π§ β¨
π SEE ALSO π
go read these next, bestie, they're iconic:
nng_strerror(3)nng_stream_dialer_alloc(3str)nng_stream_dialer_close(3str)nng_stream_dialer_free(3str)nng_aio(5)nng_stream(5)nng_stream_dialer(5)
and that's the page!! π this lil gem is from the NNG Reference Manual, dated 2026-01-13 β stay hydrated, close your dialers, and slay your async operations ππ§ββοΈ
π¦ 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