NNG_STREAM_DIALER_SET(3str)

πŸ“¦ version 1.11, in alpine 3.24

πŸ’– NAME πŸ’–

okay bestie, welcome to nng_stream_dialer_set β€” the NNG_STREAM_DIALER_SET(3str) page from the NNG Reference Manual β€” and it's literally here to set option on byte stream dialer. slay.

✨ SYNOPSIS ✨

#include <nng/nng.h>

int nng_stream_dialer_set(nng_stream_dialer *d, const char *name, const void *data, size_t size);

int nng_stream_dialer_set_bool(nng_stream_dialer *d, const char *opt, bool val);

int nng_stream_dialer_set_int(nng_stream_dialer *d, const char *opt, int val);

int nng_stream_dialer_set_ms(nng_stream_dialer *d, const char *opt, nng_duration val);

int nng_stream_dialer_set_ptr(nng_stream_dialer *d, const char *opt, void *val);

int nng_stream_dialer_set_size(nng_stream_dialer *d, const char *opt, size_t val);

int nng_stream_dialer_set_string(nng_stream_dialer *d, const char *opt, const char *val);

int nng_stream_dialer_set_uint64(nng_stream_dialer *d, const char *opt, uint64_t val);

int nng_stream_dialer_set_addr(nng_stream_dialer *d, const char *opt, const nng_sockaddr *val);

πŸ¦‹ DESCRIPTION πŸ¦‹

The nng_stream_dialer_set() functions are how you configure options for the byte stream dialer d. The actual options you can configure this way vary, and they're specified by opt. A bunch of them are documented in nng_options(5).

Also, some transport-specific and protocol-specific options are documented with the transports and protocols themselves. iykyk.

🌸 Forms 🌸

The details of the type, size, and semantics of an option depend on the actual option, and they'll be documented with the option itself. no cap.

nng_stream_dialer_set()

This one is untyped, and it can configure any arbitrary data. The val pointer addresses the data to copy, and size is the size of the object located at val.

πŸ’€ Note: this function is deprecated and will be removed in a future release. Use one of the typed functions below instead. periodt.

nng_stream_dialer_set_bool()

This function is for options that take a Boolean (bool). cute.

nng_stream_dialer_set_int()

This function is for options that take an integer (int).

nng_stream_dialer_set_ms()

This function configures time durations (such as timeouts) using the type nng_duration. The duration is an integer number of milliseconds.

nng_stream_dialer_set_ptr()

This function passes a pointer to structured data. The data referenced by the pointer 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 somewhat special in that the object is generally not copied, but instead the pointer to the object is copied. Please see the documentation for the specific option for further details.

nng_stream_dialer_set_size()

This function configures a size, typically for buffer sizes, message maximum sizes, and similar options.

nng_stream_dialer_set_string()

This function configures a string. Strings passed this way must be legal UTF-8 or ASCII strings, terminated with a NUL (\0) byte. (Other constraints may apply as well, see the documentation for each option for details.)

nng_stream_dialer_set_uint64()

This function configures a 64-bit unsigned value. This is typically used for identifiers, network numbers, and similar options.

nng_stream_dialer_set_addr()

This function configures a socket address. The value is copied, and thus the caller may discard the supplied value immediately after this function returns.

πŸŽ€ RETURN VALUES πŸŽ€

This function returns 0 on success, and non-zero otherwise.

πŸ’… ERRORS πŸ’…

  • NNG_ECLOSED β€” the dialer is closed.
  • NNG_EINVAL β€” either data or size are invalid.
  • NNG_ENOTSUP β€” the option is not supported.
  • NNG_EREADONLY β€” the option may not be modified.

🌈 SEE ALSO 🌈


and that's the whole page, bestie πŸ’– dated 2026-01-13, from the NNG_STREAM_DIALER_SET(3str) manual page in the NNG Reference Manual. go off. πŸ‘‘

πŸ“¦ where this page comes from