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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
---
version: tip
layout: manpage_v2
title: nng_socket(7)
---
<h1>nng_socket(7)</h1>
<div class="sect1">
<h2 id="_name">NAME</h2>
<div class="sectionbody">
<div class="paragraph">
<p>nng_socket - BSD Socket transport (experimental)</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_description">DESCRIPTION</h2>
<div class="sectionbody">
<div class="paragraph">
<p>
The <em>socket</em> transport supports communication between
peers across arbitrary BSD sockets, such as those that are
created with <a href="nng_socket_pair.3supp.html"><code>nng_socket_pair()</code></a>.</p>
</div>
<div class="paragraph">
<p>This transport only supports <a href="nng_listener.5.html">listeners</a>, using <a href="nng_listener_create.3.html"><code>nng_listener_create()</code></a>.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Attempts to create <a href="nng_dialer.5.html">dialers</a> using this transport will result in <code>NNG_ENOTSUP</code>.
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>The socket file descriptor is passed to the listener using the <code>NNG_OPT_SOCKET_FD</code> option (as an integer).
Setting this option will cause the listener to create a <a href="nng_pipe.5.html">pipe</a> associated backed by the file descriptor.</p>
</div>
<div class="paragraph">
<p>The protocol between peers using this transport is compatible with the protocol used for the
<a href="nng_tcp.7.html">TCP</a> transport, but this is an implementation detail and subject to change without notice.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
This transport is <strong>experimental</strong>, and at present is only supported on POSIX platforms.
</td>
</tr>
</table>
</div>
<div class="sect2">
<h3 id="_registration">Registration</h3>
<div class="paragraph">
<p>No special action is necessary to register this transport.</p>
</div>
</div>
<div class="sect2">
<h3 id="_uri_format">URI Format</h3>
<div class="paragraph">
<p>
This transport uses the URL <code>socket://</code>, without further qualification.</p>
</div>
</div>
<div class="sect2">
<h3 id="_socket_address">Socket Address</h3>
<div class="paragraph">
<p>The socket address will be of family <code>NNG_AF_UNSPEC</code>.
There are no further socket details available.</p>
</div>
</div>
<div class="sect2">
<h3 id="_transport_options">Transport Options</h3>
<div class="paragraph">
<p>The following transport option is available:</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><code>NNG_OPT_SOCKET_FD</code></dt>
<dd>
<p>(int) This is a write-only option, that may be set multiple times on a listener.
Each time this is set, the listener will create a <a href="nng_pipe.5.html">pipe</a> backed by the given file
descriptor passed as an argument.</p>
</dd>
</dl>
</div>
<div class="paragraph">
<p>Additionally, the following options may be supported on pipes when the platform supports them:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="nng_options.5.html#NNG_OPT_PEER_GID"><code>NNG_OPT_PEER_GID</code></a></p>
</li>
<li>
<p><a href="nng_options.5.html#NNG_OPT_PEER_PID"><code>NNG_OPT_PEER_PID</code></a></p>
</li>
<li>
<p><a href="nng_options.5.html#NNG_OPT_PEER_UID"><code>NNG_OPT_PEER_UID</code></a></p>
</li>
<li>
<p><a href="nng_options.5.html#NNG_OPT_PEER_ZONEID"><code>NNG_OPT_PEER_ZONEID</code></a></p>
</li>
</ul>
</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="nng_socket_pair.3supp.html">nng_socket_pair(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_pipe.5.html">nng_pipe(5)</a>,
<a href="nng_sockaddr.5.html">nng_sockaddr(5)</a>,
<a href="nng.7.html">nng(7)</a></p>
</div>
</div>
</div>
|