summaryrefslogtreecommitdiff
path: root/man/v1.7.0/nng_socket.5.html
diff options
context:
space:
mode:
authorStaysail Systems, Inc <info@staysail.tech>2024-01-01 17:24:25 -0800
committerGarrett D'Amore <garrett@damore.org>2024-01-01 17:25:59 -0800
commitff237834c56b370c6d2247a767f3886d9eb4e94c (patch)
treeae08cc1363e8836e5447558dd53f50e02708b2ae /man/v1.7.0/nng_socket.5.html
parent88b7f244642186f349f251673312e6f90f541f08 (diff)
downloadnng-ff237834c56b370c6d2247a767f3886d9eb4e94c.tar.gz
nng-ff237834c56b370c6d2247a767f3886d9eb4e94c.tar.bz2
nng-ff237834c56b370c6d2247a767f3886d9eb4e94c.zip
Manual page updates for v1.7.0
Diffstat (limited to 'man/v1.7.0/nng_socket.5.html')
-rw-r--r--man/v1.7.0/nng_socket.5.html94
1 files changed, 94 insertions, 0 deletions
diff --git a/man/v1.7.0/nng_socket.5.html b/man/v1.7.0/nng_socket.5.html
new file mode 100644
index 00000000..b34298f3
--- /dev/null
+++ b/man/v1.7.0/nng_socket.5.html
@@ -0,0 +1,94 @@
+---
+version: v1.7.0
+layout: manpage_v2
+title: nng_socket(5)
+---
+<h1>nng_socket(5)</h1>
+<div class="sect1">
+<h2 id="_name">NAME</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>nng_socket - socket handle</p>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_synopsis">SYNOPSIS</h2>
+<div class="sectionbody">
+<div class="listingblock">
+<div class="content">
+<pre class="pygments highlight"><code data-lang="c"><span class="tok-cp">#include</span> <span class="tok-cpf">&lt;nng/nng.h&gt;</span>
+
+<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>
+</div>
+<div class="sect1">
+<h2 id="_description">DESCRIPTION</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>An <code>nng_socket</code> is a handle to an underlying socket object.
+All communication between the application and remote Scalability Protocol
+peers is done through sockets.
+A given socket can have multiple dialers (<a href="nng_dialer.5.html"><code>nng_dialer</code></a>)
+and/or listeners (<a href="nng_listener.5.html"><code>nng_listener</code></a>), and multiple
+pipes (<a href="nng_pipe.5.html"><code>nng_pipe</code></a>), and
+may be connected to multiple transports at the same time.
+However, a given socket will have exactly one protocol associated with it,
+and is responsible for any state machines or other protocol-specific logic.</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_socket</code> structure is always passed by value (both
+for input parameters and return values), and should be treated opaquely.
+Passing structures this way 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>Each <code>nng_socket</code> is created by a protocol-specific constructor, such as
+<a href="nng_rep_open.3.html"><code>nng_rep_open()</code></a>.
+When the socket is no longer needed, it can be closed with
+<a href="nng_close.3.html"><code>nng_close()</code></a>.</p>
+</div>
+<div class="sect2">
+<h3 id="NNG_SOCKET_INITIALIZER">Initialization</h3>
+<div class="paragraph">
+<p>A socket may be initialized using the macro <code>NNG_SOCKET_INITIALIZER</code>
+before it is opened, to prevent confusion with valid open sockets.</p>
+</div>
+<div class="paragraph">
+<p>For example:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="pygments highlight"><code data-lang="c"><span class="tok-n">nng_socket</span> <span class="tok-n">s</span> <span class="tok-o">=</span> <span class="tok-n">NNG_SOCKET_INITIALIZER</span><span class="tok-p">;</span></code></pre>
+</div>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_see_also">SEE ALSO</h2>
+<div class="sectionbody">
+<div class="paragraph text-left">
+<p><a href="libnng.3.html">libnng(3)</a>,
+<a href="nng_close.3.html">nng_close(3)</a>,
+<a href="nng_getopt.3.html">nng_getopt(3)</a>,
+<a href="nng_setopt.3.html">nng_setopt(3)</a>,
+<a href="nng_socket_id.3.html">nng_socket_id(3)</a>,
+<a href="nng_dialer.5.html">nng_dialer(5)</a>,
+<a href="nng_listener.5.html">nng_listener(5)</a>,
+<a href="nng_options.5.html">nng_options(5)</a>,
+<a href="nng.7.html">nng(7)</a></p>
+</div>
+</div>
+</div>