summaryrefslogtreecommitdiff
path: root/man/tip/nng_stream.5.html
blob: 9c0bf067d04d77e4d11035e5cb6fcca8247cc970 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
---
version: tip
layout: manpage_v2
title: nng_stream(5)
---
<h1>nng_stream(5)</h1>
<div class="sect1">
<h2 id="_name">NAME</h2>
<div class="sectionbody">
<div class="paragraph">
<p>nng_stream - byte stream</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></span><span class="tok-cp">#include</span><span class="tok-w"> </span><span class="tok-cpf">&lt;nng/nng.h&gt;</span>

<span class="tok-k">typedef</span><span class="tok-w"> </span><span class="tok-k">struct</span><span class="tok-w"> </span><span class="tok-nc">nng_stream</span><span class="tok-w"> </span><span class="tok-n">nng_stream</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_stream</code>  represents a byte stream.
This may correspond to an underlying connection such a TCP connection or
a connected UNIX domain socket or named pipe.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
The <code>nng_stream</code> object is used for raw byte stream connections, and
should not be confused with a pipe object created on
<a href="nng_socket.5.html">socket</a> using the
<a href="nng_listen.3.html"><code>nng_listen()</code></a>,
<a href="nng_dial.3.html"><code>nng_dial()</code></a> or related functions.
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>These objects are created either establishing an outgoing connection
with
<a href="nng_stream_dialer_dial.3str.html"><code>nng_stream_dialer_dial()</code></a>
or by accepting in incoming connection with
<a href="nng_stream_listener_accept.3str.html"><code>nng_stream_listener_accept()</code></a>.</p>
</div>
<div class="paragraph">
<p>Byte streams are reliable in that data
will not be delivered out of order, or with portions missing.</p>
</div>
<div class="paragraph">
<p>Data can be sent using
<a href="nng_stream_send.3str.html"><code>nng_stream_send()</code></a> or
received with
<a href="nng_stream_recv.3str.html"><code>nng_stream_recv()</code></a>.</p>
</div>
<div class="paragraph">
<p>When the connection is no longer needed, it should be freed with
<a href="nng_stream_free.3str.html"><code>nng_stream_free()</code></a>.</p>
</div>
<div class="admonitionblock tip">
<table>
<tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
It is possible to close the connection, without freeing it, by
using
<a href="nng_stream_close.3str.html"><code>nng_stream_close()</code></a>.
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>Byte streams may, depending on the underlying technology,
support various
<a href="nng_options.5.html">options</a>, which
can be accessed using the
<a href="nng_stream_get.3str.html"><code>nng_stream_get()</code></a> and
<a href="nng_stream_set.3str.html"><code>nng_stream_set()</code></a> family of
functions.</p>
</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_stream_close.3str.html">nng_stream_close(3str)</a>,
<a href="nng_stream_dialer_dial.3str.html">nng_stream_dialer_dial(3str)</a>,
<a href="nng_stream_free.3str.html">nng_stream_free(3str)</a>,
<a href="nng_stream_get.3str.html">nng_stream_get(3str)</a>,
<a href="nng_stream_listener_accept.3str.html">nng_stream_listener_accept(3str)</a>,
<a href="nng_stream_recv.3str.html">nng_stream_recv(3str)</a>,
<a href="nng_stream_send.3str.html">nng_stream_send(3str)</a>,
<a href="nng_stream_set.3str.html">nng_stream_set(3str)</a>,
<a href="nng_options.5.html">nng_options(5)</a>,
<a href="nng.7.html">nng(7)</a>,</p>
</div>
</div>
</div>