nn::socket::Poll Function

Syntax

s32 Poll(
     PollFd fds[],
     u32 nfds,
     s32 timeout
);

Arguments

Name Description
in fds[] Specifies the socket to poll and the polling conditions as well as the PollFd array for getting the polling results.
in nfds Specifies the number of elements in the array specified in fds.
in timeout Specifies the number of milliseconds to wait for a socket to be found before timing out. Specify a value of 0 or greater, or one of the following constants.
INFTIM: Do not time out.

Return Values



Value Description
Positive value Number of socket descriptors that can read or write.
0 The call has timed out.
ENETRESET Socket library is not initialized.
EBADF Invalid socket descriptor.
EINVAL Invalid processing.

Description

Checks the specified set of multiple socket descriptors to see if reading or writing is possible for any of them.

This function monitors changes in the state of sockets. Normally, it blocks until a socket satisfying the specified conditions is found. The function unblocks if it times out without finding a socket that meets the specified conditions, if the Shutdown or Close function is used to interrupt socket sending and receiving, or if any abnormality is detected in a socket.

See Also


Revision History

2010/06/14
Initial version.

CONFIDENTIAL