NNG_STREAM_DIALER_DIAL(3str)

πŸ“¦ version 1.11, in alpine 3.24

πŸ’… 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 using nng_stream_dialer_alloc() or nng_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:


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