nn::socket::Socket Function

Syntax

s32 Socket(
     s32 af,
     s32 type,
     s32 protocol
);

Arguments

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.

Return Values



Value Description
1 or higher The new socket descriptor.
ENETRESET Socket library is not initialized.
EAFNOSUPPORT Address family not supported.
EPROTONOSUPPORT Protocol not supported.
EMFILE Cannot create any more socket descriptors.
ENOMEM Insufficient memory.
EPROTOTYPE Socket type not supported.

Description

Creates new socket descriptors.

The current version allows you to create at least eight sockets at the same time.

See Also

Close

Revision History

2010/06/14
Initial version.

CONFIDENTIAL