1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../../css/manpage.css" type="text/css" />
7    <style type="text/css"><!--
8      span.static_style
9      {
10        font-size			: 8pt;
11        color				: white;
12        font-weight			: bold;
13        background			: #44f;
14        border-left			: solid 1px #aaf;
15        border-top			: solid 1px #aaf;
16        border-right		: solid 1px #00c;
17        border-bottom		: solid 1px #00c;
18        padding-left		: 2px;
19        padding-right		: 2px;
20      }
21
22      span.virtual_style
23      {
24        font-size			 : 8pt;
25        color				 : white;
26        font-weight			: bold;
27        background			: #0a0;
28        border-left			: solid 1px #0f0;
29        border-top			: solid 1px #0f0;
30        border-right		: solid 1px #060;
31        border-bottom		: solid 1px #060;
32        padding-left		: 2px;
33        padding-right		: 2px;
34      }
35
36      span.protected_style
37      {
38        font-size			 : 8pt;
39        color				 : white;
40        font-weight			: bold;
41        background			: #444;
42        border-left			: solid 1px #ccc;
43        border-top			: solid 1px #ccc;
44        border-right		: solid 1px #222;
45        border-bottom		: solid 1px #222;
46        padding-left		: 2px;
47        padding-right		: 2px;
48      }
49        --></style>
50<title>nn::socket</title>
51  </head>
52  <body>
53<h1><CODE>nn::socket</CODE> Namespace</h1>
54<h2>Description</h2>
55    <div class="section">
56<p>Namespace for the socket API.</p><p><B>Note:</B> This library is provided for debugging purposes. If you intend to include it in your retail product, contact Nintendo at support@noa.com.<br /><br />This library's API was designed to emulate Berkeley sockets, the de facto standard for network programming interfaces. Programs written using the Berkeley socket interface can be ported relatively easily. <br /></p><!-- write here --></div>
57    <a name="struct" id="struct">
58<h2>Structures</h2>
59      <div class="section">
60        <table class="members">
61          <tr>
62            <th>
63<a href="../../nn/socket/SockAddrIn/Overview.html"><CODE>nn::socket::SockAddrIn</CODE></a>
64            </th>
65<td>An IPv4 socket structure.</td>
66          </tr>
67          <tr>
68            <th>
69<a href="../../nn/socket/SockAddr/Overview.html"><CODE>nn::socket::SockAddr</CODE></a>
70            </th>
71<td>A socket structure.</td>
72          </tr>
73          <tr>
74            <th>
75<a href="../../nn/socket/Linger/Overview.html"><CODE>nn::socket::Linger</CODE></a>
76            </th>
77<td>A structure used with <CODE>SO_LINGER</CODE> in the <CODE>GetSockOpt</CODE> and <CODE>SetSockOpt</CODE> functions.</td>
78          </tr>
79          <tr>
80            <th>
81<a href="../../nn/socket/IpMreq/Overview.html"><CODE>nn::socket::IpMreq</CODE></a>
82            </th>
83<td>A structure used with <CODE>IP_ADD_MEMBERSHIP</CODE> and <CODE>IP_DROP_MEMBERSHIP</CODE> in the <CODE>GetSockOpt</CODE> and <CODE>SetSockOpt</CODE> functions.</td>
84          </tr>
85          <tr>
86            <th>
87<a href="../../nn/socket/PollFd/Overview.html"><CODE>nn::socket::PollFd</CODE></a>
88            </th>
89<td>A structure used with the <CODE>Poll</CODE> function.</td>
90          </tr>
91          <tr>
92            <th>
93<a href="../../nn/socket/AddrInfo/Overview.html"><CODE>nn::socket::AddrInfo</CODE></a>
94            </th>
95<td>A structure used with the <CODE>GetAddrInfo</CODE> function.</td>
96          </tr>
97          <tr>
98            <th>
99<a href="../../nn/socket/HostEnt/Overview.html"><CODE>nn::socket::HostEnt</CODE></a>
100            </th>
101<td>A structure used with the <CODE>GetHostByAddr</CODE> and <CODE>GetHostByName</CODE> functions.</td>
102          </tr>
103          <tr>
104            <th>
105<a href="../../nn/socket/DnsAddr/Overview.html"><CODE>nn::socket::DnsAddr</CODE></a>
106            </th>
107<td>A structure for DNS server addresses.</td>
108          </tr> </table>
109      </div>
110    </a> <a name="enum" id="enum">
111<h2>Enumerated Types</h2>
112      <div class="section">
113        <table class="members">
114          <tr>
115            <td width="100"> </td>
116            <th>
117<a href="../../nn/socket/ProtocolFamily.html"><CODE>ProtocolFamily</CODE></a>
118            </th>
119<td>An enumerated type representing protocol families.</td>
120          </tr>
121          <tr>
122            <td width="100"> </td>
123            <th>
124<a href="../../nn/socket/AddressFamily.html"><CODE>AddressFamily</CODE></a>
125            </th>
126<td>An enumerated type representing address families.</td>
127          </tr>
128          <tr>
129            <td width="100"> </td>
130            <th>
131<a href="../../nn/socket/SocketType.html"><CODE>SocketType</CODE></a>
132            </th>
133<td>An enumerated type representing socket types.</td>
134          </tr>
135          <tr>
136            <td width="100"> </td>
137            <th>
138<a href="../../nn/socket/MessageFlag.html"><CODE>MessageFlag</CODE></a>
139            </th>
140<td>Flags given to functions such as <a href="../../nn/socket/RecvFrom.html"><CODE>RecvFrom</CODE></a> and <a href="../../nn/socket/SendTo.html"><CODE>SendTo</CODE></a>.</td>
141          </tr>
142          <tr>
143            <td width="100"> </td>
144            <th>
145<a href="../../nn/socket/PollType.html"><CODE>PollType</CODE></a>
146            </th>
147<td>Flags given to the <a href="../../nn/socket/Poll.html"><CODE>Poll</CODE></a> function.</td>
148          </tr>
149          <tr>
150            <td width="100"> </td>
151            <th>
152<a href="../../nn/socket/SocketLevel.html"><CODE>SocketLevel</CODE></a>
153            </th>
154<td>Option levels given to functions such as <a href="../../nn/socket/GetSockOpt.html"><CODE>GetSockOpt</CODE></a> and <a href="../../nn/socket/SetSockOpt.html"><CODE>SetSockOpt</CODE></a>.</td>
155          </tr>
156          <tr>
157            <td width="100"> </td>
158            <th>
159<a href="../../nn/socket/SocketOptionType.html"><CODE>SocketOptionType</CODE></a>
160            </th>
161<td>Option numbers given to the <a href="../../nn/socket/GetSockOpt.html"><CODE>GetSockOpt</CODE></a> and <a href="../../nn/socket/SetSockOpt.html"><CODE>SetSockOpt</CODE></a> functions.</td>
162          </tr>
163          <tr>
164            <td width="100"> </td>
165            <th>
166<a href="../../nn/socket/ShutdownType.html"><CODE>ShutdownType</CODE></a>
167            </th>
168<td>Flags given to the <a href="../../nn/socket/Shutdown.html"><CODE>Shutdown</CODE></a> function.</td>
169          </tr>
170          <tr>
171            <td width="100"> </td>
172            <th>
173<a href="../../nn/socket/FcntlFlag.html">FcntlFlag</a>
174            </th>
175<td>Flags given to the <a href="../../nn/socket/Fcntl.html"><CODE>Fcntl</CODE></a> function.</td>
176          </tr>
177          <tr>
178            <td width="100"> </td>
179            <th>
180<a href="../../nn/socket/FcntlOperation.html">FcntlOperation</a>
181            </th>
182<td>Values, indicating modes, given to the <a href="../../nn/socket/Fcntl.html"><CODE>Fcntl</CODE></a> function.</td>
183          </tr>
184          <tr>
185            <td width="100"> </td>
186            <th>
187<a href="../../nn/socket/AddrInfoType.html"><CODE>AddrInfoType</CODE></a>
188            </th>
189<td>Flags given to the <a href="../../nn/socket/GetAddrInfo.html"><CODE>GetAddrInfo</CODE></a> function.</td>
190          </tr>
191          <tr>
192            <td width="100"> </td>
193            <th>
194<a href="../../nn/socket/NameInfoType.html"><CODE>NameInfoType</CODE></a>
195            </th>
196<td>Flags given to the <a href="../../nn/socket/GetNameInfo.html"><CODE>GetNameInfo</CODE></a> function.</td>
197          </tr>
198          <tr>
199            <td width="100"> </td>
200            <th>
201<a href="../../nn/socket/AddrInfoError.html"><CODE>AddrInfoError</CODE></a>
202            </th>
203<td>Error values returned by the <a href="../../nn/socket/GetAddrInfo.html"><CODE>GetAddrInfo</CODE></a> and <a href="../../nn/socket/GetNameInfo.html"><CODE>GetNameInfo</CODE></a> functions.</td>
204          </tr>
205          <tr>
206            <td width="100"> </td>
207            <th>
208<a href="../../nn/socket/SocketError.html"><CODE>SocketError</CODE></a>
209            </th>
210<td>Error values shared by socket functions. Errors without descriptions are used internally and are never returned by the socket API.</td>
211          </tr> </table>
212      </div>
213    </a> <a name="function" id="function">
214<h2>Functions</h2>
215      <div class="section">
216        <table class="members">
217          <tr>
218<th class="category" colspan="3">Socket</th>
219          </tr>
220          <tr>
221            <td width="100">  </td>
222            <th>
223<a href="../../nn/socket/Socket.html"><CODE>Socket</CODE></a>
224            </th>
225<td>Creates new socket descriptors.</td>
226          </tr>
227          <tr>
228            <td width="100">  </td>
229            <th>
230<a href="../../nn/socket/Listen.html"><CODE>Listen</CODE></a>
231            </th>
232<td>Begins accepting connection requests using a stream socket (<CODE>SOCK_STREAM</CODE>).</td>
233          </tr>
234          <tr>
235            <td width="100">  </td>
236            <th>
237<a href="../../nn/socket/Accept.html"><CODE>Accept</CODE></a>
238            </th>
239<td>Accepts incoming connections.</td>
240          </tr>
241          <tr>
242            <td width="100">  </td>
243            <th>
244<a href="../../nn/socket/Bind.html"><CODE>Bind</CODE></a>
245            </th>
246<td>Allocates a local socket address to a socket.</td>
247          </tr>
248          <tr>
249            <td width="100">  </td>
250            <th>
251<a href="../../nn/socket/Connect.html"><CODE>Connect</CODE></a>
252            </th>
253<td>Uses the specified socket descriptor to attempt to connect to the specified remote host.</td>
254          </tr>
255          <tr>
256            <td width="100">  </td>
257            <th>
258<a href="../../nn/socket/RecvFrom.html"><CODE>RecvFrom</CODE></a>
259            </th>
260<td>Attempts to receive data (messages) from a remote host via a socket.</td>
261          </tr>
262          <tr>
263            <td width="100">  </td>
264            <th>
265<a href="../../nn/socket/Recv.html"><CODE>Recv</CODE></a>
266            </th>
267<td>Attempts to receive data (messages) from a remote host via a socket.</td>
268          </tr>
269          <tr>
270            <td width="100">  </td>
271            <th>
272<a href="../../nn/socket/Read.html"><CODE>Read</CODE></a>
273            </th>
274<td>Attempts to receive data (messages) from a remote host via a socket.</td>
275          </tr>
276          <tr>
277            <td width="100">  </td>
278            <th>
279<a href="../../nn/socket/SendTo.html"><CODE>SendTo</CODE></a>
280            </th>
281<td>Attempts to send data (messages) to a remote host via a socket.</td>
282          </tr>
283          <tr>
284            <td width="100">  </td>
285            <th>
286<a href="../../nn/socket/Send.html"><CODE>Send</CODE></a>
287            </th>
288<td>Attempts to send data (messages) to a remote host via a socket.</td>
289          </tr>
290          <tr>
291            <td width="100">  </td>
292            <th>
293<a href="../../nn/socket/Write.html"><CODE>Write</CODE></a>
294            </th>
295<td>Attempts to send data (messages) to a remote host via a socket.</td>
296          </tr>
297          <tr>
298            <td width="100">  </td>
299            <th>
300<a href="../../nn/socket/Close.html"><CODE>Close</CODE></a>
301            </th>
302<td>Closes a socket. Closed sockets can no longer be used.</td>
303          </tr>
304          <tr>
305            <td width="100">  </td>
306            <th>
307<a href="../../nn/socket/Shutdown.html"><CODE>Shutdown</CODE></a>
308            </th>
309<td>This function shuts down some or all socket send/receive processes.</td>
310          </tr>
311          <tr>
312            <td width="100">  </td>
313            <th>
314<a href="../../nn/socket/GetSockOpt.html"><CODE>GetSockOpt</CODE></a>
315            </th>
316<td>Gets a socket's internal settings and internal state.</td>
317          </tr>
318          <tr>
319            <td width="100">  </td>
320            <th>
321<a href="../../nn/socket/SetSockOpt.html"><CODE>SetSockOpt</CODE></a>
322            </th>
323<td>Changes a socket's internal settings and internal state.</td>
324          </tr>
325          <tr>
326            <td width="100">  </td>
327            <th>
328<a href="../../nn/socket/Fcntl.html"><CODE>Fcntl</CODE></a>
329            </th>
330<td>Sets or gets socket status flags.</td>
331          </tr>
332          <tr>
333            <td width="100">  </td>
334            <th>
335<a href="../../nn/socket/Poll.html"><CODE>Poll</CODE></a>
336            </th>
337<td>Checks the specified set of multiple socket descriptors to see if reading or writing is possible for any of them.</td>
338          </tr>
339          <tr>
340            <td width="100">  </td>
341            <th>
342<a href="../../nn/socket/SockAtMark.html"><CODE>SockAtMark</CODE></a>
343            </th>
344<td>Determines whether the specified socket has an out-of-band data mark.</td>
345          </tr>
346          <tr>
347            <td width="100">  </td>
348            <th>
349<a href="../../nn/socket/GetHostId.html"><CODE>GetHostId</CODE></a>
350            </th>
351<td>Gets the local host's primary IPv4 address.</td>
352          </tr>
353          <tr>
354            <td width="100">  </td>
355            <th>
356<a href="../../nn/socket/GetSockName.html"><CODE>GetSockName</CODE></a>
357            </th>
358<td>Gets the socket's local address.</td>
359          </tr>
360          <tr>
361            <td width="100">  </td>
362            <th>
363<a href="../../nn/socket/GetPeerName.html"><CODE>GetPeerName</CODE></a>
364            </th>
365<td>Gets the socket's remote address.</td>
366          </tr>
367          <tr>
368            <td width="100">  </td>
369            <th>
370<a href="../../nn/socket/GetHostByName.html"><CODE>GetHostByName</CODE></a>
371            </th>
372<td>Searches for host information based on the host name.</td>
373          </tr>
374          <tr>
375            <td width="100">  </td>
376            <th>
377<a href="../../nn/socket/GetHostByAddr.html"><CODE>GetHostByAddr</CODE></a>
378            </th>
379<td>Searches for host information based on the host address.</td>
380          </tr>
381          <tr>
382            <td width="100">  </td>
383            <th>
384<a href="../../nn/socket/GetAddrInfo.html"><CODE>GetAddrInfo</CODE></a>
385            </th>
386<td>This function searches for host information based on the host name and service name of the host.</td>
387          </tr>
388          <tr>
389            <td width="100">  </td>
390            <th>
391<a href="../../nn/socket/FreeAddrInfo.html"><CODE>FreeAddrInfo</CODE></a>
392            </th>
393<td>Releases the buffer that was allocated to hold search results when searching for host information using the <a href="../../nn/socket/GetAddrInfo.html"><CODE>GetAddrInfo</CODE></a> function.</td>
394          </tr>
395          <tr>
396            <td width="100">  </td>
397            <th>
398<a href="../../nn/socket/GetNameInfo.html"><CODE>GetNameInfo</CODE></a>
399            </th>
400<td>Searches for the host name and service name based on the host's address information.</td>
401          </tr>
402          <tr>
403<th class="category" colspan="3">Byte Order and Address Conversion</th>
404          </tr>
405          <tr>
406            <td width="100">  </td>
407            <th>
408<a href="../../nn/socket/InetAtoN.html"><CODE>InetAtoN</CODE></a>
409            </th>
410<td>Converts an IPv4 host address given in dot-decimal notation to numeric format.</td>
411          </tr>
412          <tr>
413            <td width="100">  </td>
414            <th>
415<a href="../../nn/socket/InetNtoA.html"><CODE>InetNtoA</CODE></a>
416            </th>
417<td>Converts an IPv4 host address given in numeric format to a string representing the address in dot-decimal notation.</td>
418          </tr>
419          <tr>
420            <td width="100">  </td>
421            <th>
422<a href="../../nn/socket/InetPtoN.html"><CODE>InetPtoN</CODE></a>
423            </th>
424<td>Converts a host address given in standard text format to numeric format.</td>
425          </tr>
426          <tr>
427            <td width="100">  </td>
428            <th>
429<a href="../../nn/socket/InetNtoP.html"><CODE>InetNtoP</CODE></a>
430            </th>
431<td>Converts a host address given in numeric format to a string representing the address in standard text format.</td>
432          </tr>
433          <tr>
434            <td width="100">  </td>
435            <th>
436<a href="../../nn/socket/HtoNl.html"><CODE>HtoNl</CODE></a>
437            </th>
438<td>Converts a 32-bit host byte order value to a network byte order value.</td>
439          </tr>
440          <tr>
441            <td width="100">  </td>
442            <th>
443<a href="../../nn/socket/NtoHl.html"><CODE>NtoHl</CODE></a>
444            </th>
445<td>Converts a 32-bit network byte order value to a host byte order value.</td>
446          </tr>
447          <tr>
448            <td width="100">  </td>
449            <th>
450<a href="../../nn/socket/HtoNs.html"><CODE>HtoNs</CODE></a>
451            </th>
452<td>Converts a 16-bit host byte order value to a network byte order value.</td>
453          </tr>
454          <tr>
455            <td width="100">  </td>
456            <th>
457<a href="../../nn/socket/NtoHs.html"><CODE>NtoHs</CODE></a>
458            </th>
459<td>Converts a 16-bit network byte order value to a host byte order value.</td>
460          </tr>
461          <tr>
462<th class="category" colspan="3">Initialization/Termination</th>
463          </tr>
464          <tr>
465            <td width="100">  </td>
466            <th>
467<a href="../../nn/socket/Initialize.html"><CODE>Initialize</CODE></a>
468            </th>
469<td>Initializes the socket library, allowing socket API functions to be called.</td>
470          </tr>
471          <tr>
472            <td width="100">  </td>
473            <th>
474<a href="../../nn/socket/GetRequiredMemorySize.html"><CODE>GetRequiredMemorySize</CODE></a>
475            </th>
476<td>Gets the minimum amount of working memory required to initialize the socket library.</td>
477          </tr>
478          <tr>
479            <td width="100">  </td>
480            <th>
481<a href="../../nn/socket/Finalize.html"><CODE>Finalize</CODE></a>
482            </th>
483<td>Finalizes the socket library and releases any resources used by it.</td>
484          </tr>
485          <tr>
486<th class="category" colspan="3">Utilities</th>
487          </tr>
488          <tr>
489            <td width="100">  </td>
490            <th>
491<a href="../../nn/socket/GetDefaultGateway.html"><CODE>GetDefaultGateway</CODE></a>
492            </th>
493<td>Gets the address of the default gateway.</td>
494          </tr>
495          <tr>
496            <td width="100">  </td>
497            <th>
498<a href="../../nn/socket/GetPrimaryAddress.html"><CODE>GetPrimaryAddress</CODE></a>
499            </th>
500<td>Gets the IP address and netmask of the local host.</td>
501          </tr>
502          <tr>
503            <td width="100">  </td>
504            <th>
505<a href="../../nn/socket/GetResolver.html"><CODE>GetResolver</CODE></a>
506            </th>
507<td>Gets the address of the DNS server to use for name resolution.</td>
508          </tr>
509          <tr>
510            <td width="100">  </td>
511            <th>
512<a href="../../nn/socket/GetMacAddress.html"><CODE>GetMacAddress</CODE></a>
513            </th>
514<td>Gets the MAC address.</td>
515          </tr>
516          <tr>
517            <td width="100">  </td>
518            <th>
519<a href="../../nn/socket/DumpRoutingTable.html"><CODE>DumpRoutingTable</CODE></a>
520            </th>
521<td>Outputs the routing table to the console.</td>
522          </tr> </table>
523      </div>
524    </a>
525<h2>Revision History</h2>
526    <div class="section">
527      <dl class="history">
528        <dt>2010/06/14</dt>
529<dd>Initial version.<br />
530        </dd>
531      </dl>
532    </div>
533  <hr><p>CONFIDENTIAL</p></body>
534</html>