nn::socket NamespaceNamespace for the socket API.
Note: This library is provided for debugging purposes. If you intend to include it in your retail product, contact Nintendo at support@noa.com.
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.
nn::socket::SockAddrIn
|
An IPv4 socket structure. |
|---|---|
nn::socket::SockAddr
|
A socket structure. |
nn::socket::Linger
|
A structure used with SO_LINGER in the GetSockOpt and SetSockOpt functions. |
nn::socket::IpMreq
|
A structure used with IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP in the GetSockOpt and SetSockOpt functions. |
nn::socket::PollFd
|
A structure used with the Poll function. |
nn::socket::AddrInfo
|
A structure used with the GetAddrInfo function. |
nn::socket::HostEnt
|
A structure used with the GetHostByAddr and GetHostByName functions. |
nn::socket::DnsAddr
|
A structure for DNS server addresses. |
ProtocolFamily
|
An enumerated type representing protocol families. | |
|---|---|---|
AddressFamily
|
An enumerated type representing address families. | |
SocketType
|
An enumerated type representing socket types. | |
MessageFlag
|
Flags given to functions such as RecvFrom and SendTo. |
|
PollType
|
Flags given to the Poll function. |
|
SocketLevel
|
Option levels given to functions such as GetSockOpt and SetSockOpt. |
|
SocketOptionType
|
Option numbers given to the GetSockOpt and SetSockOpt functions. |
|
ShutdownType
|
Flags given to the Shutdown function. |
|
| FcntlFlag | Flags given to the Fcntl function. |
|
| FcntlOperation | Values, indicating modes, given to the Fcntl function. |
|
AddrInfoType
|
Flags given to the GetAddrInfo function. |
|
NameInfoType
|
Flags given to the GetNameInfo function. |
|
AddrInfoError
|
Error values returned by the GetAddrInfo and GetNameInfo functions. |
|
SocketError
|
Error values shared by socket functions. Errors without descriptions are used internally and are never returned by the socket API. |
| Socket | ||
|---|---|---|
Socket
|
Creates new socket descriptors. | |
Listen
|
Begins accepting connection requests using a stream socket (SOCK_STREAM). |
|
Accept
|
Accepts incoming connections. | |
Bind
|
Allocates a local socket address to a socket. | |
Connect
|
Uses the specified socket descriptor to attempt to connect to the specified remote host. | |
RecvFrom
|
Attempts to receive data (messages) from a remote host via a socket. | |
Recv
|
Attempts to receive data (messages) from a remote host via a socket. | |
Read
|
Attempts to receive data (messages) from a remote host via a socket. | |
SendTo
|
Attempts to send data (messages) to a remote host via a socket. | |
Send
|
Attempts to send data (messages) to a remote host via a socket. | |
Write
|
Attempts to send data (messages) to a remote host via a socket. | |
Close
|
Closes a socket. Closed sockets can no longer be used. | |
Shutdown
|
This function shuts down some or all socket send/receive processes. | |
GetSockOpt
|
Gets a socket's internal settings and internal state. | |
SetSockOpt
|
Changes a socket's internal settings and internal state. | |
Fcntl
|
Sets or gets socket status flags. | |
Poll
|
Checks the specified set of multiple socket descriptors to see if reading or writing is possible for any of them. | |
SockAtMark
|
Determines whether the specified socket has an out-of-band data mark. | |
GetHostId
|
Gets the local host's primary IPv4 address. | |
GetSockName
|
Gets the socket's local address. | |
GetPeerName
|
Gets the socket's remote address. | |
GetHostByName
|
Searches for host information based on the host name. | |
GetHostByAddr
|
Searches for host information based on the host address. | |
GetAddrInfo
|
This function searches for host information based on the host name and service name of the host. | |
FreeAddrInfo
|
Releases the buffer that was allocated to hold search results when searching for host information using the GetAddrInfo function. |
|
GetNameInfo
|
Searches for the host name and service name based on the host's address information. | |
| Byte Order and Address Conversion | ||
InetAtoN
|
Converts an IPv4 host address given in dot-decimal notation to numeric format. | |
InetNtoA
|
Converts an IPv4 host address given in numeric format to a string representing the address in dot-decimal notation. | |
InetPtoN
|
Converts a host address given in standard text format to numeric format. | |
InetNtoP
|
Converts a host address given in numeric format to a string representing the address in standard text format. | |
HtoNl
|
Converts a 32-bit host byte order value to a network byte order value. | |
NtoHl
|
Converts a 32-bit network byte order value to a host byte order value. | |
HtoNs
|
Converts a 16-bit host byte order value to a network byte order value. | |
NtoHs
|
Converts a 16-bit network byte order value to a host byte order value. | |
| Initialization/Termination | ||
Initialize
|
Initializes the socket library, allowing socket API functions to be called. | |
GetRequiredMemorySize
|
Gets the minimum amount of working memory required to initialize the socket library. | |
Finalize
|
Finalizes the socket library and releases any resources used by it. | |
| Utilities | ||
GetDefaultGateway
|
Gets the address of the default gateway. | |
GetPrimaryAddress
|
Gets the IP address and netmask of the local host. | |
GetResolver
|
Gets the address of the DNS server to use for name resolution. | |
GetMacAddress
|
Gets the MAC address. | |
DumpRoutingTable
|
Outputs the routing table to the console. | |
CONFIDENTIAL