diff options
Diffstat (limited to 'docs/ref/str/nng_stream_dialer_dial.adoc')
| -rw-r--r-- | docs/ref/str/nng_stream_dialer_dial.adoc | 37 |
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] |
