nn::socket::Close Function
s32 Close(
s32 s
);
| Name | Description | |
|---|---|---|
| in | s | Specifies the socket descriptor. Specify a socket descriptor created using the Socket or Accept function. |
| Value | Description |
|---|---|
| 0 | Process was successful. |
ENETRESET |
Socket library is not initialized. |
ENETDOWN |
The network is not available. |
EBADF |
Invalid socket descriptor. |
ENOTCONN |
Not connected. |
EINVAL |
Invalid processing. |
Closes a socket. Closed sockets can no longer be used.
If there are currently any blocked function calls that used the socket that this function closes, the blocks are released and those functions return their various predefined errors.
When you close a stream socket (SOCK_STREAM) that has not been set to non-blocking mode using the Fcntl function, the connection is closed in compliance with the Linger option setting.
The default behavior is for Close to return immediately without blocking. Then, after any data remaining to be sent is automatically transferred in the background, the resources used by the socket are released.
CONFIDENTIAL