NNG_STREAM_DIALER_GET(3str)
π
nng_stream_dialer_get(3str) β get option from byte stream dialer β¨
okay bestie, welcome to the NNG Reference Manual π this is the page for nng_stream_dialer_get, and it is literally all about pulling option values out of a byte stream dialer. no cap.
π NAME π
nng_stream_dialer_get β get option from byte stream dialer π
β¨ SYNOPSIS β¨
#include <nng/nng.h>
int nng_stream_dialer_get(nng_stream_dialer *d, const char *opt, void *val, size_t *sizep);
int nng_stream_dialer_get_bool(nng_stream_dialer *d, const char *opt, bool *valp);
int nng_stream_dialer_get_int(nng_stream_dialer *d, const char *opt, int *valp);
int nng_stream_dialer_get_ms(nng_stream_dialer *d, const char *opt, nng_duration *valp);
int nng_stream_dialer_get_ptr(nng_stream_dialer *d, const char *opt, void **valp);
int nng_stream_dialer_get_size(nng_stream_dialer *d, const char *opt, size_t *valp);
int nng_stream_dialer_get_addr(nng_stream_dialer *d, const char *opt, nng_sockaddr *valp);
int nng_stream_dialer_get_string(nng_stream_dialer *d, const char *opt, char **valp);
int nng_stream_dialer_get_uint64(nng_stream_dialer *d, const char *opt, uint64_t *valp);
π¦ DESCRIPTION π¦
the nng_stream_dialer_get() functions are used to retrieve option values for the byte stream dialer d. π
the actual options that may be retrieved this way vary. a number of them are documented in nng_options(5) and additional linked documents. π
π Forms π
in all of these forms, the option opt is retrieved from the connected byte stream dialer d. the forms vary based on the type of the option they take. π«Ά
the details of the type, size, and semantics of the option will depend on the actual option, and will be documented with the option itself. iykyk. π
nng_stream_dialer_get()β this function is untyped and can be used to retrieve the value of any option. the caller must store a pointer to a buffer to receive the value inval, and the size of the buffer shall be stored at the location referenced bysizep. β¨
when the function returns, the actual size of the data copied (or that would have been copied if sufficient space were present) is stored at the location referenced by sizep. if the callerβs buffer is not large enough to hold the entire object, then the copy is truncated. therefore the caller should check for truncation by verifying that the returned size in sizep does not exceed the original buffer size. π
it is acceptable to pass NULL for val if the value in sizep is zero. this can be used to determine the size of the buffer needed to receive the object. π§
Note: this function is deprecated. use one of the typed functions instead. π
nng_stream_dialer_get_bool()β this function is for options which take a Boolean (bool). πΈnng_stream_dialer_get_int()β this function is for options which take an integer (int). βnng_stream_dialer_get_ms()β this function is used to retrieve time durations (such as timeouts), stored as a number of milliseconds. the special valueNNG_DURATION_INFINITEmeans an infinite amount of time, and the special valueNNG_DURATION_DEFAULTmeans a context-specific default. β³nng_stream_dialer_get_ptr()β this function is used to retrieve a pointer to structured data. the data referenced is generally managed using other functions. note that this form is somewhat special in that the object is generally not copied, but instead the pointer to the object is copied. π
Note: care must be taken to ensure that the application respects any considerations about the lifetime of the underlying object. see the documentation for the option for more specific guidance. π«Ά
nng_stream_dialer_get_size()β this function is used to retrieve a size, typically for buffer sizes, message maximum sizes, and similar options. πnng_stream_dialer_get_addr()β this function is used to retrieve a socket address. π°οΈnng_stream_dialer_get_string()β this function is used to retrieve a NULL-terminated string. this string is created from the source usingnng_strdup()and consequently must be freed by the caller usingnng_strfree()when it is no longer needed. πnng_stream_dialer_get_uint64()β this function is used to retrieve a 64-bit unsigned value. this is typically used for identifiers, network numbers, and similar options. π’
π RETURN VALUES π
these functions return 0 on success, and non-zero otherwise. slay. β
π ERRORS π
NNG_ECLOSEDβ the dialer is closed. πNNG_EINVALβ there was insufficient space to receive the object. the amount of data actually needed is returned insizep. πNNG_ENOTSUPβ the option is not supported. π«NNG_EWRITEONLYβ the option may not read. π
π«Ά SEE ALSO π«Ά
mwah π β this cutie was brought to you by the NNG Reference Manual, dated 2026-01-13. stay slay, bestie. π«Άβ¨
π¦ where this page comes from
- alpine 3.24: nng-doc 1.11-r0 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms