NNG_DIALER_START(3)

πŸ“¦
version 1.12.0 Β· 4 versions
, in ubuntu stonking

πŸ’… 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 socket s is 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 dialer d is 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