IPC@CHIP® RTOS-PPC – API Documentation
Socket descriptor set. More...
Socket descriptor set, used by the API function select( ).
This data structure provides a bit field to specify which sockets to monitor and which sockets events occur in the select() API. Each bit corresponds to a socket. The socket descriptor is used to provide the mapping between bits and sockets. For example for a socket with descriptor zero, this socket will be represented by bit 0 in this field, which will be the most significant bit of first fd_mask in the array. A set of macros are provided in the Beck C-library for manipulating these bit fields:
FD_SET (n, p) :
Sets bit 'n' in fd_set at pointer 'p' to 1.
FD_CLR (n, p) :
Zeroes bit 'n' in fd_set at pointer 'p'.
FD_ISSET (n, p):
Tests bit 'n' in fd_set at pointer 'p'.
FD_ZERO (p) :
Clears all bits in fd_set at pointer 'p'.
FD_COPY (src, dest) :
Copies object at pointer 'src' into the object at pointer 'dest'. The intent here is that both of these pointers reference a fd_set structure, but the compiler will not type check this for you.
Also the socket iterator function FD_Next() is available to sequence through a set of sockets.