NNG_DIALER_SET(3)
π 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. thevalpointer addresses the data to copy, andvalszis the size of the object located atval.
Note π this function is deprecated. use the typed functions below instead, babe.
nng_dialer_set_bool()β for options that take a Boolean (bool). thebvalgets passed to the option.nng_dialer_set_int()β for options that take an integer (int). theivalgets passed to the option.nng_dialer_set_ms()β this one configures time durations (think timeouts β¨) using typenng_duration. the durationduris an integer number of milliseconds.nng_dialer_set_ptr()β this one passes a pointer,ptr, to structured data. the data thatptrreferences 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 aNUL(\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β parameterddoes not refer to an open dialer.NNG_EINVALβ the value being passed is invalid.NNG_ENOTSUPβ the optionoptis not supported.NNG_EREADONLYβ the optionoptis read-only.NNG_ESTATEβ the dialerdis 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
- 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