NNG_DIALER_SET(3)

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

πŸ’– NNG_DIALER_SET β€” the nng dialer set situation πŸ’–

okay bestie, so this is a page from the NNG Reference Manual, and it's all about nng_dialer_set β€” the little family of functions that lets you configure a dialer. no cap, it's genuinely useful, let's get into it πŸ¦‹


✨ NAME ✨

nng_dialer_set β€” set dialer option


✨ SYNOPSIS ✨

#include <nng/nng.h>

int nng_dialer_set(nng_dialer d, const char *opt, const void *val,
    size_t valsz);

int nng_dialer_set_bool(nng_dialer d, const char *opt, bool bval);

int nng_dialer_set_int(nng_dialer d, const char *opt, int ival);

int nng_dialer_set_ms(nng_dialer d, const char *opt, nng_duration dur);

int nng_dialer_set_ptr(nng_dialer d, const char *opt, void *ptr);

int nng_dialer_set_size(nng_dialer d, const char *opt, size_t z);

int nng_dialer_set_string(nng_dialer d, const char *opt, const char *str);

int nng_dialer_set_uint64(nng_dialer d, const char *opt, uint64_t u64);

✨ DESCRIPTION ✨

so the nng_dialer_set() functions are how you configure options for the dialer d. πŸŽ€ which options you can actually set this way depends β€” it varies! and a whole bunch of them are documented over in nng_options(5).

also, some transport-specific options get documented with the transports themselves, so if you're looking for one of those, go check the transport's own docs. iykyk πŸ’…

Note 🫢 once a dialer has started, it's generally not possible to change its configuration. like, that ship has sailed, bestie.

🌸 Forms 🌸

in every single one of these forms, the option opt is the thing being configured, on the dialer d.

the details of the type, size, and semantics of the option all depend on the actual option you're setting β€” and those get documented with the option itself. so read the option's own docs, fr fr.

  • nng_dialer_set() β€” this one is untyped, so it can configure literally any arbitrary data. the val pointer addresses the data to copy, and valsz is the size of the object located at val.
Note 😭 this function is deprecated. use the typed functions below instead, babe.
  • nng_dialer_set_bool() β€” for options that take a Boolean (bool). the bval gets passed to the option.
  • nng_dialer_set_int() β€” for options that take an integer (int). the ival gets passed to the option.
  • nng_dialer_set_ms() β€” this one configures time durations (think timeouts ✨) using type nng_duration. the duration dur is an integer number of milliseconds.
  • nng_dialer_set_ptr() β€” this one passes a pointer, ptr, to structured data. the data that ptr references is generally managed by other functions. for example, TLS configuration objects created with (nng_tls_config_alloc()) can be passed this way. 🧚
Note πŸ”₯ this form is kinda special β€” the object itself is generally not copied. instead, the pointer to the object is copied.
  • nng_dialer_set_size() β€” configures a size, z. typically for buffer sizes, message maximum sizes, and similar options.
  • nng_dialer_set_string() β€” configures a string, str. strings passed this way must be legal UTF-8 or ASCII strings, terminated with a NUL (\0) byte. (other constraints may apply too β€” check the documentation for each option for the deets.)
  • nng_dialer_set_uint64() β€” configures a 64-bit unsigned value, u64. typically used for options related to identifiers, network numbers, and such. πŸ‘‘

✨ RETURN VALUES ✨

these functions return 0 on success, and non-zero otherwise. simple as that, slay πŸ’–


✨ ERRORS ✨

  • NNG_EBADTYPE β€” incorrect type for option.
  • NNG_ECLOSED β€” parameter d does not refer to an open dialer.
  • NNG_EINVAL β€” the value being passed is invalid.
  • NNG_ENOTSUP β€” the option opt is not supported.
  • NNG_EREADONLY β€” the option opt is read-only.
  • NNG_ESTATE β€” the dialer d is already started.

✨ SEE ALSO ✨

nng_dialer_create(3) nng_dialer_get(3) nng_strerror(3), nng_dialer(5), nng_duration(5), nng_options(5), nng(7)


and that's the whole page, bestie, you ate it πŸ’…βœ¨ this was pulled from the NNG Reference Manual, dated 2026-06-30 β€” go forth and configure your dialers responsibly 🫢🌈

πŸ“¦ where this page comes from