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