#include <nitroWiFi/soc.h>
#define SOC_POLLRDNORM 0x0001 // Normal data read
#define SOC_POLLWRNORM 0x0008 // Normal data write
#define SOC_POLLERR 0x0020 // Error (revents only)
#define SOC_POLLHUP 0x0040 // Disconnected (revents only)
#define SOC_POLLNVAL 0x0080 // Invalid fd (revents only)
typedef struct SOCPollFD
{
int fd;
short events; // input event flags
short revents; // output event flags
} SOCPollFD;
int SOC_Poll( SOCPollFD fds[], unsigned nfds, OSTick timeout );
fds |
The SOCPollFD array. |
nfds |
The number of SOCPollFD in the fds array. |
timeout |
Timeout. When negative, no timeout. |
Positive value | Number of socket descriptors that can read or write. |
0 | The call has timed out. |
Note: Additional errors may be generated and returned in future library releases. Please treat all negative return values as general errors.
This function checks the specified socket descriptors and determines if any can read or write.
Note: :SOC_Poll()
indicates that read or write process is possible. Therefore, with SOC_Read()
, SOC_Write()
or SOC_Accept()
functions that follow SOC_Poll()
, there may be cases where the called thread sleeps or an error is returned.
09/13/2005 Initial version.