select TCP UDP
Check if any sockets are ready for available read or write operations or error conditions. See function NetSock_Sel() for more information.
Files
net_bsd.h/net_bsd.c
Prototype
int select ( int desc_nbr_max, struct fd_set *p_desc_rd, struct fd_set *p_desc_wr, struct fd_set *p_desc_err, struct timeval *p_timeout);
Arguments
desc_nbr_max
Maximum number of file descriptors in the file descriptor sets.
p_desc_rd
Pointer to a set of file descriptors to:
- Check for available read operations.
- Return:
- The actual file descriptors ready for available read operations if no error(s).
- The initial, non-modified set of file descriptors on any error(s).
- Return a null-valued (i.e. zero-cleared) descriptor set if any timeout expires.
p_desc_wr
Pointer to a set of file descriptors to:
- Check for available write operations.
- Return:
- The actual file descriptors ready for available write operations if no error(s).
- The initial, non-modified set of file descriptors on any error(s).
- A null-valued (i.e. zero-cleared) descriptor set if any timeout expires.
p_desc_err
Pointer to a set of file descriptors to:
- Check for any errors and/or exceptions.
- Return:
- The actual file descriptors flagged with an error and/or exception if no non-descriptor-related error(s).
- The initial, non-modified set of file descriptors, on any error(s).
- A null-valued (i.e. zero-cleared) descriptor set if any timeout expires.
p_timeout
Pointer to a timeout.
Returned Value
The number of file descriptors with available resources and/or operations if any.
0, on timeout.
-1, otherwise.