NNG_DIALER_SETOPT(3)
β¨ nng_dialer_setopt β set dialer option β¨
okay so bestie, welcome to the NNG Reference Manual page for nng_dialer_setopt(3) π this is the one where you go and poke settings into a dialer, so let's get into it π«Ά
πΈ NAME πΈ
nng_dialer_setopt β set dialer option π
β¨ SYNOPSIS β¨
#include <nng/nng.h>
int nng_dialer_setopt(nng_dialer d, const char *opt, const void *val,
size_t valsz);
int nng_dialer_setopt_bool(nng_dialer d, const char *opt, bool bval);
int nng_dialer_setopt_int(nng_dialer d, const char *opt, int ival);
int nng_dialer_setopt_ms(nng_dialer d, const char *opt, nng_duration dur);
int nng_dialer_setopt_ptr(nng_dialer d, const char *opt, void *ptr);
int nng_dialer_setopt_size(nng_dialer d, const char *opt, size_t z);
int nng_dialer_setopt_string(nng_dialer d, const char *opt, const char *str);
int nng_dialer_setopt_uint64(nng_dialer d, const char *opt, uint64_t u64);
π DESCRIPTION π
Important β these functions are deprecated π like, they still work but they're giving "old era". Please seenng_dialer_setinstead. And heads up: they may not even be present if the library was built withNNG_ELIDE_DEPRECATED. so if you can't find them, that's why bestie, it's not you π
The nng_dialer_setopt() functions are how you configure options for the dialer d. Which options you can actually set this way varies, and a whole bunch of them are documented over in nng_options(5).
Also, some transport-specific options live with the transports themselves, so go read those pages if you're looking for something niche π
Note β once a dialer has started, it's generally not possible to change its configuration. So like... set it up before you send it off. periodt β¨
π Forms π
In every single one of these forms, the option opt gets configured on the dialer d.
The details of the type, the size, and the semantics of the option all depend on the actual option itself, and they'll be documented right there with that option. iykyk π
nng_dialer_setopt()
This one is untyped, and it can be used to configure any arbitrary data. The val pointer addresses the data to copy, and valsz is the size of the object located at val.
Tip β honestly? it might be easier to use one of the typed forms of this function instead π«Ά
nng_dialer_setopt_bool()
This one is for options that take a Boolean (bool). The bval gets passed to the option.
nng_dialer_setopt_int()
This one is for options that take an integer (int). The ival gets passed to the option.
nng_dialer_setopt_ms()
This one is for configuring time durations (like timeouts, you know the vibe) using the type nng_duration. The duration dur is an integer number of milliseconds β±οΈ
nng_dialer_setopt_ptr()
This one is for passing 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 a lil bit special, because the object is generally not copied β instead, the pointer to the object is what gets copied. so yeah, mind that π
nng_dialer_setopt_size()
This one is for configuring a size, z β typically for buffer sizes, message maximum sizes, and similar kinds of options π
nng_dialer_setopt_string()
This one is for configuring 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 as well β check the documentation for each option for the details, fr fr.)
nng_dialer_setopt_uint64()
This one is for configuring a 64-bit unsigned value, u64. This is typically used for options related to identifiers, network numbers, and that kind of thing π’
π RETURN VALUES π
These functions return 0 on success, and non-zero otherwise. slay when it's 0 β¨
π 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. not you trying to write it bestie πNNG_ESTATEβ The dialerdis already started.
π¦ SEE ALSO π¦
nng_dialer_create(3) nng_dialer_getopt(3) nng_strerror(3), nng_dialer(5), nng_duration(5), nng_options(5), nng(7)
and that's the whole page bestie, you ate that π this was the NNG_DIALER_SETOPT(3) page from the NNG Reference Manual, dated 2026-06-30 β go forth and configure your dialers responsibly, mwah ππ§ββοΈπ
π¦ 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