NNG_DIALER_START(3)
π NNG_DIALER_START(3) β the nng_dialer_start manual, bestie edition π
okay so this is the page for nng_dialer_start, straight out of the NNG Reference Manual. it's a little three-parter: you got a dialer, you got flags, and you got β¨vibesβ¨ (the vibes being "please connect to somebody"). let's get into it π¦
πΈ NAME πΈ
nng_dialer_start β start that dialer, no cap
β¨ SYNOPSIS β¨
#include <nng/nng.h>
int nng_dialer_start(nng_dialer d, int flags);
π DESCRIPTION π
so nng_dialer_start() literally just starts the dialer d. that's it, that's the function π
what "start" means here: it makes the dialer begin connecting to the address it was created with. like, the dialer has been sitting there with an address in its pocket this whole time and now we're finally letting it go do the thing π«Ά
and when a connection actually gets established? that results in a pipe being created, and that pipe gets attached to the dialer's socket. so cute. so functional. π
okay now the important part, so listen up bestie π
normally, the first attempt to connect to the dialer's address happens synchronously, and that includes any name resolution it needs. which means: if that first try fails β say the connection gets refused β the failure comes back to you immediately, and no further action will be taken. like, it just stops. that's it. done. π
BUT. if you pass the special value NNG_FLAG_NONBLOCK in flags, then the connection attempt gets made asynchronously instead. slay β¨
also lowkey important: if the connection was closed for a synchronously dialed connection, the dialer will still attempt to redial asynchronously. it does not give up, it is giving main character energy π₯
π Tip NNG_FLAG_NONBLOCK can genuinely help your application be more resilient, but it also generally makes diagnosing failures somewhat more difficult. so likeβ¦ tradeoffs, bestie. pick your struggle π
and one more thing, because it matters: once a dialer has started, it is generally not possible to change its configuration. the dialer has made its choices and it's committing to them. periodt. π
π«Ά RETURN VALUES π«Ά
this function returns 0 on success, and non-zero otherwise. that's the whole deal π
π ERRORS π
here's the full menu of things that can go wrong, no skipping, we list them all:
NNG_EADDRINVALβ an invalid url was specified. bad address, babe πNNG_ECLOSEDβ the socketsis not open.NNG_ECONNREFUSEDβ the remote peer refused the connection. rude tbh π€NNG_ECONNRESETβ the remote peer reset the connection. also rude!!NNG_EINVALβ an invalid set of flags was specified. your flags did not pass the vibe check π©NNG_ENOMEMβ insufficient memory is available. we are out of brain cells (RAM) πNNG_EPEERAUTHβ authentication or authorization failure. you shall not pass πNNG_EPROTOβ a protocol error occurred. the protocols are fighting π₯NNG_ESTATEβ the dialerdis already started. bestie it's already doing the thing, calm down πNNG_EUNREACHABLEβ the remote address is not reachable. it's not you, it's the network π¦
β SEE ALSO β
nng_dial(3), nng_dialer_create(3) nng_strerror(3), nng_dialer(5), nng(7)
go read those too, iykyk π
and that's the whole page, bestie!! π this one's from the NNG Reference Manual, dated 2026-06-30, and it was NNG_DIALER_START(3) all along π ok bye, go start a dialer, love u ππΈβ¨
π¦ 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