NNG_DIALER_GET(3)
π NAME π
okay so nng_dialer_get β it gets you a dialer option. that's it, that's the whole vibe β¨
π SYNOPSIS π
like, here's the whole squad, all glowey and ready:
#include <nng/nng.h>
int nng_dialer_get(nng_dialer d, const char *opt, void *val, size_t *valszp);
int nng_dialer_get_bool(nng_dialer d, const char *opt, bool *bvalp);
int nng_dialer_get_int(nng_dialer d, const char *opt, int *ivalp);
int nng_dialer_get_ms(nng_dialer d, const char *opt, nng_duration *durp);
int nng_dialer_get_ptr(nng_dialer d, const char *opt, void **ptr);
int nng_dialer_get_size(nng_dialer d, const char *opt, size_t *zp);
int nng_dialer_get_addr(nng_dialer d, const char *opt, nng_sockaddr *sap);
int nng_dialer_get_string(nng_dialer d, const char *opt, char **strp);
int nng_dialer_get_uint64(nng_dialer d, const char *opt, uint64_t *u64p);
int nng_dialer_get_url(nng_dialer d, const nng_url **url);
πΈ DESCRIPTION πΈ
so bestie, the nng_dialer_get() functions are your little keychain that pulls option values back out of the dialer d. π«Ά the actual options you can yank this way are not a fixed list β they vary! β and a whole bunch of them live over in nng_options(5).
plus, some options are transport-specific and get documented right alongside their transport, iykyk. π
β¨ Forms β¨
in literally all of these forms, the option opt gets retrieved from the dialer d. the only thing that changes form-to-form is the type of thing the option hands back.
and the tea on the type, size, and semantics of any given option? that's entirely up to the option itself, and it's documented with the option, not here. no cap.
nng_dialer_get()β the untyped one, the wildcard, the main character. it can retrieve the value of any option. you gotta stash a pointer to your receiving buffer inval, and the size of that buffer has to be stored at the locationvalszppoints to.
when it comes back, the actual size of the data that got copied β or that would have been copied if there'd been enough room β gets stored at the location valszp points to. so if your buffer wasn't big enough to hold the whole object, the copy just gets truncated. π so yeah, you should check that the returned size in valszp doesn't exceed your original buffer size, 'cause that's how you catch truncation.
it's totally acceptable to pass NULL for val as long as the value in valszp is zero β that's the move for figuring out how big a buffer you need to receive the object. π§
Note π This function is deprecated. use one of the typed functions listed below instead, bestie. it's giving legacy.
nng_dialer_get_bool()β for options that take a Boolean (bool). the value lands atbvalp.nng_dialer_get_int()β for options that take an integer (int). the value lands ativalp.nng_dialer_get_ms()β for grabbing time durations (think timeouts), stored indurpas a number of milliseconds. β±οΈ (NNG_DURATION_INFINITEis the special value that means an infinite amount of time, andNNG_DURATION_DEFAULTis the special value that means a context-specific default.)nng_dialer_get_ptr()β for grabbing a pointer,ptr, to structured data. the data thatptrpoints at is generally managed with other functions. and ngl this form is a lil special β the object is generally not copied, instead the pointer to the object is what gets copied. πnng_dialer_get_size()β for grabbing a size into the pointerzp. typically buffer sizes, message maximum sizes, and options in that same lane.nng_dialer_get_addr()β for grabbing annng_sockaddrinto the value thatsappoints at.nng_dialer_get_string()β for grabbing a string intostrp. this string is created from the source usingnng_strdup(), so consequently the caller must free it withnng_strfree()once it's no longer needed. don't leave it hanging. πnng_dialer_get_uint64()β for grabbing a 64-bit unsigned value into the value thatu64ppoints at. typically for options related to identifiers, network numbers, and similar.nng_dialer_get_url()β for obtaining the URL that the dialer is configured for. π
π RETURN VALUES π
these functions return 0 on success, and non-zero otherwise. slay when it's zero, not slay when it isn't.
π ERRORS π
NNG_EBADTYPEβ incorrect type for option. wrong vibe entirely.NNG_ECLOSEDβ the parameterddoes not refer to an open dialer.NNG_EINVALβ size of destinationvaltoo small for object.NNG_ENOMEMβ insufficient memory exists.NNG_ENOTSUPβ the optionoptis not supported.NNG_EWRITEONLYβ the optionoptis write-only. look, don't touch. π«
π¦ SEE ALSO π¦
nng_dialer_create(3) nng_dialer_set(3) nng_strdup(3), nng_strerror(3), nng_strfree(3), nng_dialer(5), nng_duration(5), nng_options(5), nng_sockaddr(5), nng(7)
okay that's the whole page, bestie, you ate. π this was the NNG Reference Manual's NNG_DIALER_GET(3), dated 2026-06-30 β go forth and get those dialer options, periodt. π
π¦ 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