summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--man/tip/nng_ctx.5.html17
-rw-r--r--man/tip/nng_dialer.5.html17
-rw-r--r--man/tip/nng_listener.5.html17
-rw-r--r--man/tip/nng_options.5.html105
-rw-r--r--man/tip/nng_pipe.5.html17
-rw-r--r--man/tip/nng_socket.5.html13
-rw-r--r--man/tip/nng_tcp.7.html33
-rw-r--r--man/tip/nng_tls.7.html16
8 files changed, 196 insertions, 39 deletions
diff --git a/man/tip/nng_ctx.5.html b/man/tip/nng_ctx.5.html
index e5d16bed..f6252614 100644
--- a/man/tip/nng_ctx.5.html
+++ b/man/tip/nng_ctx.5.html
@@ -526,7 +526,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<div class="content">
<pre class="pygments highlight"><code data-lang="c"><span></span><span class="tok-cp">#include</span> <span class="tok-cpf">&lt;nng/nng.h&gt;</span><span class="tok-cp"></span>
-<span class="tok-k">typedef</span> <span class="tok-kt">uint32_t</span> <span class="tok-n">nng_ctx</span></code></pre>
+<span class="tok-k">typedef</span> <span class="tok-k">struct</span> <span class="tok-n">nng_ctx_s</span> <span class="tok-n">nng_ctx</span></code></pre>
</div>
</div>
</div>
@@ -550,6 +550,21 @@ of any sent request, a timer to retry the request on failure, and so forth.
A separate context on the same socket can have similar data, but corresponding
to a completely different request.</p>
</div>
+<div class="admonitionblock important">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-important" title="Important"></i>
+</td>
+<td class="content">
+The <code>nng_ctx</code> 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.
+</td>
+</tr>
+</table>
+</div>
<div class="paragraph">
<p>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.</p>
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
<div class="content">
<pre class="pygments highlight"><code data-lang="c"><span></span><span class="tok-cp">#include</span> <span class="tok-cpf">&lt;nng/nng.h&gt;</span><span class="tok-cp"></span>
-<span class="tok-k">typedef</span> <span class="tok-kt">uint32_t</span> <span class="tok-n">nng_dialer</span><span class="tok-p">;</span></code></pre>
+<span class="tok-k">typedef</span> <span class="tok-k">struct</span> <span class="tok-n">nng_dialer_s</span> <span class="tok-n">nng_dialer</span><span class="tok-p">;</span></code></pre>
</div>
</div>
</div>
@@ -550,6 +550,21 @@ destroyed.</p>
or <a href="nng_dial.3.html"><code>nng_dial()</code></a> functions, and are always &#8220;owned&#8221;
by a single <a href="nng_socket.5.html"><code>nng_socket</code></a>.</p>
</div>
+<div class="admonitionblock important">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-important" title="Important"></i>
+</td>
+<td class="content">
+The <code>nng_dialer</code> 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.
+</td>
+</tr>
+</table>
+</div>
<div class="admonitionblock tip">
<table>
<tr>
diff --git a/man/tip/nng_listener.5.html b/man/tip/nng_listener.5.html
index 8ebfcfb6..1c6eeb5f 100644
--- a/man/tip/nng_listener.5.html
+++ b/man/tip/nng_listener.5.html
@@ -525,7 +525,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<div class="content">
<pre class="pygments highlight"><code data-lang="c"><span></span><span class="tok-cp">#include</span> <span class="tok-cpf">&lt;nng/nng.h&gt;</span><span class="tok-cp"></span>
-<span class="tok-k">typedef</span> <span class="tok-kt">uint32_t</span> <span class="tok-n">nng_listener</span><span class="tok-p">;</span></code></pre>
+<span class="tok-k">typedef</span> <span class="tok-k">struct</span> <span class="tok-n">nng_listener_s</span> <span class="tok-n">nng_listener</span><span class="tok-p">;</span></code></pre>
</div>
</div>
</div>
@@ -546,6 +546,21 @@ server can have many connections to multiple clients simultaneously.</p>
or <a href="nng_listen.3.html"><code>nng_listen()</code></a> functions, and are always &#8220;owned&#8221;
by a single <a href="nng_socket.5.html"><code>nng_socket</code></a>.</p>
</div>
+<div class="admonitionblock important">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-important" title="Important"></i>
+</td>
+<td class="content">
+The <code>nng_listener</code> 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.
+</td>
+</tr>
+</table>
+</div>
<div class="admonitionblock tip">
<table>
<tr>
diff --git a/man/tip/nng_options.5.html b/man/tip/nng_options.5.html
index 7eb5bfcf..d9ac65ea 100644
--- a/man/tip/nng_options.5.html
+++ b/man/tip/nng_options.5.html
@@ -529,21 +529,23 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<div class="content">
<pre class="pygments highlight"><code data-lang="c"><span></span><span class="tok-cp">#include</span> <span class="tok-cpf">&lt;nng/nng.h&gt;</span><span class="tok-cp"></span>
-<span class="tok-cp">#define NNG_OPT_SOCKNAME &quot;socket-name&quot;</span>
-<span class="tok-cp">#define NNG_OPT_RAW &quot;raw&quot;</span>
-<span class="tok-cp">#define NNG_OPT_RECVBUF &quot;recv-buffer&quot;</span>
-<span class="tok-cp">#define NNG_OPT_SENDBUF &quot;send-buffer&quot;</span>
-<span class="tok-cp">#define NNG_OPT_RECVFD &quot;recv-fd&quot;</span>
-<span class="tok-cp">#define NNG_OPT_SENDFD &quot;send-fd&quot;</span>
-<span class="tok-cp">#define NNG_OPT_RECVTIMEO &quot;recv-timeout&quot;</span>
-<span class="tok-cp">#define NNG_OPT_SENDTIMEO &quot;send-timeout&quot;</span>
-<span class="tok-cp">#define NNG_OPT_LOCADDR &quot;local-address&quot;</span>
-<span class="tok-cp">#define NNG_OPT_REMADDR &quot;remote-address&quot;</span>
-<span class="tok-cp">#define NNG_OPT_URL &quot;url&quot;</span>
-<span class="tok-cp">#define NNG_OPT_MAXTTL &quot;ttl-max&quot;</span>
-<span class="tok-cp">#define NNG_OPT_RECVMAXSZ &quot;recv-size-max&quot;</span>
-<span class="tok-cp">#define NNG_OPT_RECONNMINT &quot;reconnect-time-min&quot;</span>
-<span class="tok-cp">#define NNG_OPT_RECONNMAXT &quot;reconnect-time-max&quot;</span></code></pre>
+<span class="tok-cp">#define NNG_OPT_SOCKNAME &quot;socket-name&quot;</span>
+<span class="tok-cp">#define NNG_OPT_RAW &quot;raw&quot;</span>
+<span class="tok-cp">#define NNG_OPT_RECVBUF &quot;recv-buffer&quot;</span>
+<span class="tok-cp">#define NNG_OPT_SENDBUF &quot;send-buffer&quot;</span>
+<span class="tok-cp">#define NNG_OPT_RECVFD &quot;recv-fd&quot;</span>
+<span class="tok-cp">#define NNG_OPT_SENDFD &quot;send-fd&quot;</span>
+<span class="tok-cp">#define NNG_OPT_RECVTIMEO &quot;recv-timeout&quot;</span>
+<span class="tok-cp">#define NNG_OPT_SENDTIMEO &quot;send-timeout&quot;</span>
+<span class="tok-cp">#define NNG_OPT_LOCADDR &quot;local-address&quot;</span>
+<span class="tok-cp">#define NNG_OPT_REMADDR &quot;remote-address&quot;</span>
+<span class="tok-cp">#define NNG_OPT_URL &quot;url&quot;</span>
+<span class="tok-cp">#define NNG_OPT_MAXTTL &quot;ttl-max&quot;</span>
+<span class="tok-cp">#define NNG_OPT_RECVMAXSZ &quot;recv-size-max&quot;</span>
+<span class="tok-cp">#define NNG_OPT_RECONNMINT &quot;reconnect-time-min&quot;</span>
+<span class="tok-cp">#define NNG_OPT_RECONNMAXT &quot;reconnect-time-max&quot;</span>
+<span class="tok-cp">#define NNG_OPT_TCP_NODELAY &quot;tcp-nodelay&quot;</span>
+<span class="tok-cp">#define NNG_OPT_TCP_KEEPALIVE &quot;tcp-nodelay&quot;</span></code></pre>
</div>
</div>
</div>
@@ -956,6 +958,79 @@ application.
</tr>
</table>
</div>
+<div id="NNG_OPT_TCP_NODELAY" class="dlist">
+<dl>
+<dt class="hdlist1"><code>NNG_OPT_TCP_NODELAY</code></dt>
+<dd>
+<p>(<code>bool`</code>)
+This option is used to disable (or enable) the use of Nagle&#8217;s algorithm
+for TCP connections.
+When <code>true</code> (the default), messages are sent immediately by the underlying
+TCP stream without waiting to gather more data.
+When <code>false</code>, Nagle&#8217;s algorithm is enabled, and the TCP stream may
+wait briefly in attempt to coalesce messages.
+Nagle&#8217;s algorithm is useful on low-bandwidth connections to reduce overhead,
+but it comes at a cost to latency.</p>
+</dd>
+</dl>
+</div>
+<div class="admonitionblock note">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-note" title="Note"></i>
+</td>
+<td class="content">
+This setting may apply to transports that are built on top of TCP.
+See the transport documentation for each transport for details.
+</td>
+</tr>
+</table>
+</div>
+<div id="NNG_OPT_TCP_KEEPALIVE" class="dlist">
+<dl>
+<dt class="hdlist1"><code>NNG_OPT_TCP_KEEPALIVE</code></dt>
+<dd>
+<p>(<code>bool`</code>)
+This option is used to enable the sending of keep-alive messages on
+the underlying TCP stream.
+This option is <code>false</code> 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.</p>
+</dd>
+</dl>
+</div>
+<div class="admonitionblock note">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-note" title="Note"></i>
+</td>
+<td class="content">
+This setting may apply to transports that are built on top of TCP.
+See the transport documentation for each transport for details.
+</td>
+</tr>
+</table>
+</div>
+<div class="admonitionblock tip">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-tip" title="Tip"></i>
+</td>
+<td class="content">
+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.
+</td>
+</tr>
+</table>
+</div>
</div>
</div>
</div>
diff --git a/man/tip/nng_pipe.5.html b/man/tip/nng_pipe.5.html
index 90878eeb..46d76fac 100644
--- a/man/tip/nng_pipe.5.html
+++ b/man/tip/nng_pipe.5.html
@@ -525,7 +525,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<div class="content">
<pre class="pygments highlight"><code data-lang="c"><span></span><span class="tok-cp">#include</span> <span class="tok-cpf">&lt;nng/nng.h&gt;</span><span class="tok-cp"></span>
-<span class="tok-k">typedef</span> <span class="tok-kt">uint32_t</span> <span class="tok-n">nng_pipe</span><span class="tok-p">;</span></code></pre>
+<span class="tok-k">typedef</span> <span class="tok-k">struct</span> <span class="tok-n">nng_pipe_s</span> <span class="tok-n">nng_pipe</span><span class="tok-p">;</span></code></pre>
</div>
</div>
</div>
@@ -542,6 +542,21 @@ single TCP or IPC connection.)
Pipes are associated with either the listener or dialer that created them,
and therefore are also automatically associated with a single socket.</p>
</div>
+<div class="admonitionblock important">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-important" title="Important"></i>
+</td>
+<td class="content">
+The <code>nng_pipe</code> 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.
+</td>
+</tr>
+</table>
+</div>
<div class="admonitionblock tip">
<table>
<tr>
diff --git a/man/tip/nng_socket.5.html b/man/tip/nng_socket.5.html
index a6aa2d16..880e7cf8 100644
--- a/man/tip/nng_socket.5.html
+++ b/man/tip/nng_socket.5.html
@@ -525,7 +525,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<div class="content">
<pre class="pygments highlight"><code data-lang="c"><span></span><span class="tok-cp">#include</span> <span class="tok-cpf">&lt;nng/nng.h&gt;</span><span class="tok-cp"></span>
-<span class="tok-k">typedef</span> <span class="tok-kt">uint32_t</span> <span class="tok-n">nng_socket</span><span class="tok-p">;</span></code></pre>
+<span class="tok-k">typedef</span> <span class="tok-k">struct</span> <span class="tok-n">nng_socket_s</span> <span class="tok-n">nng_socket</span><span class="tok-p">;</span></code></pre>
</div>
</div>
</div>
@@ -544,16 +544,17 @@ may be connected to multiple transports at the same time.
However, a given socket will have exactly one &#8220;protocol&#8221; associated with it,
and is responsible for any state machines or other protocol-specific logic.</p>
</div>
-<div class="admonitionblock note">
+<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
-<i class="fa icon-note" title="Note"></i>
+<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
-Although <code>nng_socket</code> 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 <code>nng_socket</code> 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.
</td>
</tr>
</table>
diff --git a/man/tip/nng_tcp.7.html b/man/tip/nng_tcp.7.html
index ba24b629..3b2d18ab 100644
--- a/man/tip/nng_tcp.7.html
+++ b/man/tip/nng_tcp.7.html
@@ -625,20 +625,25 @@ the actual structure is either of type
</div>
<div class="sect2">
<h3 id="_transport_options">Transport Options</h3>
-<div class="paragraph">
-<p>The <em>nng_tcp</em> transport has no special options.</p>
-</div>
-<div class="admonitionblock note">
-<table>
-<tr>
-<td class="icon">
-<i class="fa icon-note" title="Note"></i>
-</td>
-<td class="content">
-Options for TCP keepalive, linger, and nodelay are planned.
-</td>
-</tr>
-</table>
+<div class="dlist">
+<dl>
+<dt class="hdlist1"><code>NNG_OPT_TCP_KEEPALIVE</code></dt>
+<dd>
+<p>This option is used to configure TCP keep-alives.
+The value is of type <code>bool</code>, and defaults to <code>false</code>.</p>
+</dd>
+<dt class="hdlist1"><code>NNG_OPT_TCP_NODELAY</code></dt>
+<dd>
+<p>This option is used to configure Nagle&#8217;s algorithm.
+When enabled (<code>false</code>), 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 <code>bool</code> and defaults to <code>true</code>.</p>
+</dd>
+</dl>
</div>
</div>
</div>
diff --git a/man/tip/nng_tls.7.html b/man/tip/nng_tls.7.html
index 24897141..9cb5cfa0 100644
--- a/man/tip/nng_tls.7.html
+++ b/man/tip/nng_tls.7.html
@@ -693,6 +693,22 @@ Note that setting these must be done before the transport is started.</p>
</div>
<div class="dlist">
<dl>
+<dt class="hdlist1"><code>NNG_OPT_TCP_KEEPALIVE</code></dt>
+<dd>
+<p>This option is used to configure TCP keep-alives.
+The value is of type <code>bool</code>, and defaults to <code>false</code>.</p>
+</dd>
+<dt class="hdlist1"><code>NNG_OPT_TCP_NODELAY</code></dt>
+<dd>
+<p>This option is used to configure Nagle&#8217;s algorithm.
+When enabled (<code>false</code>), 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 <code>bool</code> and defaults to <code>true</code>.</p>
+</dd>
<dt class="hdlist1"><code>NNG_OPT_TLS_CONFIG</code></dt>
<dd>
<p>This option is used on an endpoint to access the underlying TLS