diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-02-16 19:11:06 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-02-16 19:11:06 -0800 |
| commit | 2d2287ed043b22aeedffbf155d623800e40c554a (patch) | |
| tree | e563241d6ef94dcf0ad48d51ff0d3385257a8b1e | |
| parent | 72757bd87a8c3801137348dd026901032b8b623d (diff) | |
| download | nng-2d2287ed043b22aeedffbf155d623800e40c554a.tar.gz nng-2d2287ed043b22aeedffbf155d623800e40c554a.tar.bz2 nng-2d2287ed043b22aeedffbf155d623800e40c554a.zip | |
Fix nng_listen_start to add NNG_FLAG_NONBLOCK.
| -rw-r--r-- | docs/nng_listen.adoc | 2 | ||||
| -rw-r--r-- | docs/nng_listener_create.adoc | 2 | ||||
| -rw-r--r-- | docs/nng_listener_start.adoc | 15 |
3 files changed, 15 insertions, 4 deletions
diff --git a/docs/nng_listen.adoc b/docs/nng_listen.adoc index 56552f01..f7c861eb 100644 --- a/docs/nng_listen.adoc +++ b/docs/nng_listen.adoc @@ -72,11 +72,11 @@ This function returns 0 on success, and non-zero otherwise. == SEE ALSO -<<nng_strerror#,nng_strerror(3)>>, <<nng_dial#,nng_dial(3)>>, <<nng_listener_close#,nng_listener_close(3)>>, <<nng_listener_create#,nng_listener_create(3)>> <<nng_listener_start#,nng_listener_start(3)>>, +<<nng_strerror#,nng_strerror(3)>>, <<nng#,nng(7)>> == COPYRIGHT diff --git a/docs/nng_listener_create.adoc b/docs/nng_listener_create.adoc index ca3dff62..550b37ba 100644 --- a/docs/nng_listener_create.adoc +++ b/docs/nng_listener_create.adoc @@ -62,13 +62,13 @@ This function returns 0 on success, and non-zero otherwise. == SEE ALSO -<<nng_strerror#,nng_strerror(3)>>, <<nng_dialer_create#,nng_dialer_create(3)>> <<nng_listen#,nng_listen(3)>>, <<nng_listener_close#,nng_listener_close(3)>>, <<nng_listener_getopt#,nng_listener_getopt(3)>>, <<nng_listener_setopt#,nng_listener_setopt(3)>>, <<nng_listener_start#,nng_listener_start(3)>>, +<<nng_strerror#,nng_strerror(3)>>, <<nng#,nng(7)>> == COPYRIGHT diff --git a/docs/nng_listener_start.adoc b/docs/nng_listener_start.adoc index c034bfab..43ace2bd 100644 --- a/docs/nng_listener_start.adoc +++ b/docs/nng_listener_start.adoc @@ -19,17 +19,28 @@ nng_listener_start - start listener ----------- #include <nng/nng.h> -int nng_listener_start(nng_listener l); +int nng_listener_start(nng_listener l, int flags); ----------- == DESCRIPTION The `nng_listener_start()` function starts the listener _l_. -This causes the listener to start accepting connections from remote +This causes the listener to bind to the address it was created with, +and to start accepting connections from remote dialers. Each new connection results in a pipe, which will be attached to the listener's socket. +Normally, the act of "binding" to it's address is done +synchronously, including any necessary name resolution. As a result, +a failure, such as if the address is already in use, will be returned +immediately. However, if the special value `NNG_FLAG_NONBLOCK` is +supplied in _flags_, then this is done asynchronously; furthermore any +failure to bind will be periodically reattempted in the background. + +TIP: While `NNG_FLAG_NONBLOCK` can help an application be more resilient, +it also generally makes diagnosing failures somewhat more difficult. + Once a listener has started, it is generally not possible to change it's configuration. |
