#include <nng/nng.h>
-typedef uint32_t nng_ctx
+typedef struct nng_ctx_s nng_ctx
From e22f9c9f23d69abbbf3acbd668a22df9664705a2 Mon Sep 17 00:00:00 2001
From: Garrett D'Amore
+typedef struct nng_ctx_s nng_ctx
#include <nng/nng.h>
-typedef uint32_t nng_ctx
| + + | +
+The nng_ctx structure is always passed by value (both
+for input parameters and return values), and should be treated opaquely.
+Passing structures this way ensures gives the compiler a chance to perform
+accurate type checks in functions passing values of this type.
+ |
+
All contexts share the same socket, and so some options, as well as the underlying transport details, will be common to all contexts on that socket.
diff --git a/man/tip/nng_dialer.5.html b/man/tip/nng_dialer.5.html index 8d1992fe..77e85678 100644 --- a/man/tip/nng_dialer.5.html +++ b/man/tip/nng_dialer.5.html @@ -525,7 +525,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b#include <nng/nng.h>
-typedef uint32_t nng_dialer;
+typedef struct nng_dialer_s nng_dialer;
nng_dial() functions, and are always “owned”
by a single nng_socket.
+| + + | +
+The nng_dialer structure is always passed by value (both
+for input parameters and return values), and should be treated opaquely.
+Passing structures this way ensures gives the compiler a chance to perform
+accurate type checks in functions passing values of this type.
+ |
+
| + + | +
+The nng_listener structure is always passed by value (both
+for input parameters and return values), and should be treated opaquely.
+Passing structures this way ensures gives the compiler a chance to perform
+accurate type checks in functions passing values of this type.
+ |
+
NNG_OPT_TCP_NODELAY(bool`)
+This option is used to disable (or enable) the use of Nagle’s algorithm
+for TCP connections.
+When true (the default), messages are sent immediately by the underlying
+TCP stream without waiting to gather more data.
+When false, Nagle’s algorithm is enabled, and the TCP stream may
+wait briefly in attempt to coalesce messages.
+Nagle’s algorithm is useful on low-bandwidth connections to reduce overhead,
+but it comes at a cost to latency.
| + + | ++This setting may apply to transports that are built on top of TCP. +See the transport documentation for each transport for details. + | +
NNG_OPT_TCP_KEEPALIVE(bool`)
+This option is used to enable the sending of keep-alive messages on
+the underlying TCP stream.
+This option is false by default.
+When enabled, if no messages are seen for a period of time, then
+a zero length TCP message is sent with the ACK flag set in an attempt
+to tickle some traffic from the peer.
+If none is still seen (after some platform-specific number of retries and
+timeouts), then the remote peer is presumed dead, and the connection is closed.
| + + | ++This setting may apply to transports that are built on top of TCP. +See the transport documentation for each transport for details. + | +
| + + | ++This option has two purposes. +First, it can be used to detect dead peers on an otherwise quiescent network. +Second, it can be used to keep connection table entries in NAT and other +middleware from being expiring due to lack of activity. + | +
#include <nng/nng.h>
-typedef uint32_t nng_pipe;
+typedef struct nng_pipe_s nng_pipe;
| + + | +
+The nng_pipe structure is always passed by value (both
+for input parameters and return values), and should be treated opaquely.
+Passing structures this way ensures gives the compiler a chance to perform
+accurate type checks in functions passing values of this type.
+ |
+
| - + |
-Although nng_socket is an integer data type, these objects are not
-ordinary file descriptors, and can only be used with the functions that
-explicitly indicate that it safe and appropropate to do so.
+The nng_socket structure is always passed by value (both
+for input parameters and return values), and should be treated opaquely.
+Passing structures this way ensures gives the compiler a chance to perform
+accurate type checks in functions passing values of this type.
|
The nng_tcp transport has no special options.
-| - - | --Options for TCP keepalive, linger, and nodelay are planned. - | -
NNG_OPT_TCP_KEEPALIVEThis option is used to configure TCP keep-alives.
+The value is of type bool, and defaults to false.
NNG_OPT_TCP_NODELAYThis option is used to configure Nagle’s algorithm.
+When enabled (false), the underlying TCP stream will attempt
+to buffer and coalesce messages before sending them on, waiting
+a short interval to improve buffering and reduce the overhead
+caused by sending too-small messages.
+This comes at a cost to latency, and is not recommended with modern
+high speed networks.
+The value is of type bool and defaults to true.
NNG_OPT_TCP_KEEPALIVEThis option is used to configure TCP keep-alives.
+The value is of type bool, and defaults to false.
NNG_OPT_TCP_NODELAYThis option is used to configure Nagle’s algorithm.
+When enabled (false), the underlying TCP stream will attempt
+to buffer and coalesce messages before sending them on, waiting
+a short interval to improve buffering and reduce the overhead
+caused by sending too-small messages.
+This comes at a cost to latency, and is not recommended with modern
+high speed networks.
+The value is of type bool and defaults to true.
NNG_OPT_TLS_CONFIGThis option is used on an endpoint to access the underlying TLS -- cgit v1.2.3-70-g09d2