diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-04-08 20:18:34 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-04-08 20:18:34 -0700 |
| commit | 1a66ecd1098d4d8e10806e32741acc35a6d08f8d (patch) | |
| tree | 9b651cfd0d9d1fa2b316a3236eba7f2d264e3566 /docs/ref/str/nng_stream_dialer_alloc.adoc | |
| parent | c7f7bcb6e2cfbf66c7fab158b0ac02890243b5bb (diff) | |
| download | nng-doc-reorg.tar.gz nng-doc-reorg.tar.bz2 nng-doc-reorg.zip | |
nng_stream_* converteddoc-reorg
Diffstat (limited to 'docs/ref/str/nng_stream_dialer_alloc.adoc')
| -rw-r--r-- | docs/ref/str/nng_stream_dialer_alloc.adoc | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/docs/ref/str/nng_stream_dialer_alloc.adoc b/docs/ref/str/nng_stream_dialer_alloc.adoc new file mode 100644 index 00000000..d18d6733 --- /dev/null +++ b/docs/ref/str/nng_stream_dialer_alloc.adoc @@ -0,0 +1,46 @@ +## nng_stream_dialer_alloc + +Allocate byte stream dialer. + +### Synopsis + +```c +#include <nng/nng.h> + +int nng_stream_dialer_alloc(nng_stream_dialer **dp, const char *addr); + +int nng_stream_dialer_alloc_url(nng_stream_dialer **dp, const nng_url *url); +``` + +### Description + +These functions allocates a dialer for byte streams. +Dialers create byte stream objects by initiating outgoing connections, via the xref:nng_stream_dialer_dial.adoc[`nng_stream_dialer_dial`] function. + +The first form, `nng_stream_dialer_alloc`, connects to the address specified by _addr_, which should be a string representing a URL. + +The second form, `nng_stream_dialer_alloc_url`, takes a pre-parsed or pre-constructed +xref:../util/nng_url.adoc[`nng_url`] object to determine the remote address. + +These functions may support different URL schemes, such as `ipc://`, `tcp://`, `tls+tcp://`, or `ws://`. + +Both forms store the dialer in the location referenced by _dp_. + +### Return Values + +These functions return 0 on success, and non-zero otherwise. + +### Errors + +[horizontal] +`NNG_ENOMEM`:: Insufficient free memory exists. +`NNG_ENOTSUP`:: The URL scheme is not supported by the implementation. +`NNG_EADDRINVAL`:: The URL requested is invalid. + +### See Also + +xref:nng_stream_dialer_close.adoc[nng_stream_dialer_close], +xref:nng_stream_dialer_dial.adoc[nng_stream_dialer_dial], +xref:nng_stream_dialer_free.adoc[nng_stream_dialer_free], +xref:nng_stream_dialer_get.adoc[nng_stream_dialer_get], +xref:nng_stream_dialer_set.adoc[nng_stream_dialer_set] |
