From 2d2287ed043b22aeedffbf155d623800e40c554a Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 16 Feb 2018 19:11:06 -0800 Subject: Fix nng_listen_start to add NNG_FLAG_NONBLOCK. --- docs/nng_listen.adoc | 2 +- docs/nng_listener_create.adoc | 2 +- docs/nng_listener_start.adoc | 15 +++++++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) (limited to 'docs') 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 -<>, <>, <>, <> <>, +<>, <> == 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 -<>, <> <>, <>, <>, <>, <>, +<>, <> == 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 -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. -- cgit v1.2.3-70-g09d2