summaryrefslogtreecommitdiff
path: root/docs/ref/str/nng_stream_dialer_dial.adoc
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-04-08 20:18:34 -0700
committerGarrett D'Amore <garrett@damore.org>2024-04-08 20:18:34 -0700
commit1a66ecd1098d4d8e10806e32741acc35a6d08f8d (patch)
tree9b651cfd0d9d1fa2b316a3236eba7f2d264e3566 /docs/ref/str/nng_stream_dialer_dial.adoc
parentc7f7bcb6e2cfbf66c7fab158b0ac02890243b5bb (diff)
downloadnng-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_dial.adoc')
-rw-r--r--docs/ref/str/nng_stream_dialer_dial.adoc37
1 files changed, 37 insertions, 0 deletions
diff --git a/docs/ref/str/nng_stream_dialer_dial.adoc b/docs/ref/str/nng_stream_dialer_dial.adoc
new file mode 100644
index 00000000..ee7eb99b
--- /dev/null
+++ b/docs/ref/str/nng_stream_dialer_dial.adoc
@@ -0,0 +1,37 @@
+## nng_stream_dialer_dial
+
+Initiate outgoing byte stream connection.
+
+### Synopsis
+
+```c
+#include <nng/nng.h>
+
+void nng_stream_dialer_dial(nng_stream_dialer *d, nng_aio *aio);
+```
+
+### Description
+
+The `nng_stream_dialer_dial` attempts to establish a connection to the remote peer for the dialer _d_.
+The operation is completed asynchronously, using _aio_.
+
+TIP: The peer address is determined by the address specified using xref:nng_stream_dialer_alloc.adoc[`nng_stream_dialer_alloc`] or xref:nng_stream_dialer_alloc.adoc[`nng_stream_dialer_alloc_url`].
+
+If a connection is successfully established, the _aio_ will have the resulting `nng_stream` object stored as its first output.
+(See xref:../aio/nng_aio_get_output.adoc[`nng_aio_get_output`].)
+
+### Errors
+
+[horizontal]
+`NNG_EADDRINVAL`:: The address specified is invalid.
+`NNG_ECANCELED`:: The operation was aborted.
+`NNG_ECLOSED`:: The dialer is closed.
+`NNG_ECONNREFUSED`:: The connection was refused by the server.
+`NNG_ECONNRESET`:: The connection was reset by the server.
+`NNG_ENOMEM`:: Insufficient free memory exists.
+
+### See Also
+
+xref:../aio/index.adoc[Asynchronous I/O],
+xref:nng_stream_dialer_alloc.adoc[nng_stream_dialer_alloc],
+xref:nng_stream_dialer_close.adoc[nng_stream_dialer_close]