nn::socket::Socket Function
s32 Socket(
s32 af,
s32 type,
s32 protocol
);
| Name | Description | |
|---|---|---|
| in | af | Specify PF_INET. |
| in | type | Specifies the type of socket to create. Currently, SOCK_STREAM and SOCK_DGRAM are supported. |
| in | protocol | Specifies the protocol to use with the socket. If protocol is 0, the default protocol for the specified protocol family and type is used. Currently, 0 is the only value you can specify. |
| Value | Description |
|---|---|
| 1 or higher | The new socket descriptor. |
EAFNOSUPPORT |
The protocol family is not supported. |
EINVAL |
Invalid call. |
EMFILE |
The maximum supported number of sockets has been exceeded. |
ENETDOWN |
The network is not available. |
ENETRESET |
Socket library is not initialized. |
ENOMEM |
Cannot allocate the memory required for the process. |
EPROTOTYPE |
The socket type is not supported. |
EOPNOTSUPP |
The socket is not a stream socket. |
EWOULDBLOCK |
Same as EAGAIN. |
Creates new socket descriptors.
The current version allows you to create at least eight sockets at the same time.
CONFIDENTIAL