aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-12-28 21:49:05 -0800
committerGarrett D'Amore <garrett@damore.org>2018-12-28 21:49:05 -0800
commit02e90dd4f29037e43f28e3bd1e912d4092011d23 (patch)
tree88947d896e7f40b0c7897644e61024243566f21b
parentee16d11a59120cd4d981e0dcb90741fa4141372a (diff)
downloadnng-02e90dd4f29037e43f28e3bd1e912d4092011d23.tar.gz
nng-02e90dd4f29037e43f28e3bd1e912d4092011d23.tar.bz2
nng-02e90dd4f29037e43f28e3bd1e912d4092011d23.zip
fixes #833 nng_listener_listen and nng_listen ignore the flags
fixes #829 nn_dial function annotation in nng.h
-rw-r--r--docs/man/nng_listen.3.adoc13
-rw-r--r--docs/man/nng_listener_start.3.adoc12
-rw-r--r--include/nng/nng.h14
3 files changed, 10 insertions, 29 deletions
diff --git a/docs/man/nng_listen.3.adoc b/docs/man/nng_listen.3.adoc
index 41d1fa9f..e569da4f 100644
--- a/docs/man/nng_listen.3.adoc
+++ b/docs/man/nng_listen.3.adoc
@@ -36,6 +36,8 @@ An incoming connection generally results in and
Unlike dialers, listeners generally can create many
pipes, which may be open concurrently.
+The _flags_ argument is ignored, but reserved for future use.
+
TIP: While it is convenient to think of listeners as "`servers`", the
relationship between the listener or dialer is orthogonal to any server or
client status that might be associated with a given protocol.
@@ -43,17 +45,6 @@ For example, a <<nng_req.7#,_req_>>
socket might have associated dialers, but might also have associated listeners.
It may even have some of each at the same time!
-Normally, the act of "`binding`" to the address indicated by _url_ 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.
-
Because the listener is started immediately, it is generally not possible
to apply extra configuration; if that is needed applications should consider
using `<<nng_listener_create.3#,nng_listener_create()>>` and
diff --git a/docs/man/nng_listener_start.3.adoc b/docs/man/nng_listener_start.3.adoc
index 852a859a..4703c9ca 100644
--- a/docs/man/nng_listener_start.3.adoc
+++ b/docs/man/nng_listener_start.3.adoc
@@ -32,17 +32,7 @@ dialers.
Each new connection results in an `<<nng_pipe.5#,nng_pipe>>` object,
which will be attached to the listener's socket.
-Normally, the act of "`binding`" to its 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.
+The _flags_ argument is ignored, but reserved for future use.
Once a listener has started, it is generally not possible to change
its configuration.
diff --git a/include/nng/nng.h b/include/nng/nng.h
index 47560134..5ea9d374 100644
--- a/include/nng/nng.h
+++ b/include/nng/nng.h
@@ -247,19 +247,19 @@ NNG_DECL int nng_getopt_string(nng_socket, const char *, char **);
// nng_listen creates a listening endpoint with no special options,
// and starts it listening. It is functionally equivalent to the legacy
// nn_bind(). The underlying endpoint is returned back to the caller in the
-// endpoint pointer, if it is not NULL. The flags may be NNG_FLAG_SYNCH to
-// indicate that a failure setting the socket up should return an error
-// back to the caller immediately.
+// endpoint pointer, if it is not NULL. The flags are ignored at present.
NNG_DECL int nng_listen(nng_socket, const char *, nng_listener *, int);
// nng_dial creates a dialing endpoint, with no special options, and
// starts it dialing. Dialers have at most one active connection at a time
// This is similar to the legacy nn_connect(). The underlying endpoint
// is returned back to the caller in the endpoint pointer, if it is not NULL.
-// The flags may be NNG_FLAG_SYNCH to indicate that the first attempt to
-// dial will be made synchronously, and a failure condition returned back
-// to the caller. (If the connection is dropped, it will still be
-// reconnected in the background -- only the initial connect is synchronous.)
+// The flags may be NNG_FLAG_NONBLOCK to indicate that the first attempt to
+// dial will be made in the background, returning control to the caller
+// immediately. In this case, if the connection fails, the function will
+// keep retrying in the background. (If the connection is dropped in either
+// case, it will still be reconnected in the background -- only the initial
+// connection attempt is normally synchronous.)
NNG_DECL int nng_dial(nng_socket, const char *, nng_dialer *, int);
// nng_dialer_create creates a new dialer, that is not yet started.