diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-02-16 20:03:11 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-02-16 20:03:11 -0800 |
| commit | f5d62f2b434300070048d4f07630afde4a1d760d (patch) | |
| tree | b91c7739aab139339b17112e45d7e5b534a82872 /docs/nng_dialer_create.adoc | |
| parent | 2d2287ed043b22aeedffbf155d623800e40c554a (diff) | |
| download | nng-f5d62f2b434300070048d4f07630afde4a1d760d.tar.gz nng-f5d62f2b434300070048d4f07630afde4a1d760d.tar.bz2 nng-f5d62f2b434300070048d4f07630afde4a1d760d.zip | |
Add dialer documentation.
Diffstat (limited to 'docs/nng_dialer_create.adoc')
| -rw-r--r-- | docs/nng_dialer_create.adoc | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/docs/nng_dialer_create.adoc b/docs/nng_dialer_create.adoc new file mode 100644 index 00000000..d65dd9e4 --- /dev/null +++ b/docs/nng_dialer_create.adoc @@ -0,0 +1,78 @@ += nng_dialer_create(3) +:doctype: manpage +:manmanual: nng +:mansource: nng +:manvolnum: 3 +:copyright: Copyright 2018 mailto:info@staysail.tech[Staysail Systems, Inc.] + \ + Copyright 2018 mailto:info@capitar.com[Capitar IT Group BV] + \ + {blank} + \ + This document is supplied under the terms of the \ + https://opensource.org/licenses/MIT[MIT License]. + +== NAME + +nng_dialer_create - create dialer + +== SYNOPSIS + +[source, c] +----------- +#include <nng/nng.h> + +int nng_dialer_create(nng_dialer *dialerp, nng_socket s, const char *url); +----------- + +== DESCRIPTION + +The `nng_dialer_create()` function creates a newly initialized +dialer, associated with socket _s_, and configured to connect to the +address specified by _url_, and stores a pointer to at the location +referenced by _dialerp_. + +Dialers initiate a remote connection to a listener. Upon a successful +connection being established, they create a pipe, add it to the socket, +and then wait for that pipe to be closed. When the pipe is closed, +they will re-initiate the connection. Dialer's will also periodically +retry a connection automatically if an attempt to connect asynchronously +fails. + +TIP: While it is convenient to think of dialers as "clients", the relationship +between the listener or dialer is orthogonal to any server or client status +that might be associated with a given protocol. For example, a <<nng_req#,REQ>> +socket might have associated dialers, but might also have associated listeners. +It may even have some of each at the same time! + +The dialer is not started, but may be further configured with +the <<nng_dialer_setopt#,nng_dialer_setopt(3)>> family of +functions. + +Once it is fully configured, the dialer may be started using the +<<nng_dialer_start#,nng_dialer_start(3)>> function. + +TIP: If no specific configuration is required, consider using the +simpler <<nng_dial#,nng_dial(3)>> function instead. + +== RETURN VALUES + +This function returns 0 on success, and non-zero otherwise. + +== ERRORS + +`NNG_EADDRINVAL`:: An invalid _url_ was specified. +`NNG_ECLOSED`:: The socket _s_ is not open. +`NNG_ENOMEM`:: Insufficient memory is available. + +== SEE ALSO + +<<nng_dial#,nng_dial(3)>>, +<<nng_dialer_close#,nng_dialer_close(3)>>, +<<nng_dialer_getopt#,nng_dialer_getopt(3)>>, +<<nng_dialer_setopt#,nng_dialer_setopt(3)>>, +<<nng_dialer_start#,nng_dialer_start(3)>>, +<<nng_listener_create#,nng_listener_create(3)>> +<<nng_strerror#,nng_strerror(3)>>, +<<nng#,nng(7)>> + +== COPYRIGHT + +{copyright} |
