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