User`s guide

KwikNet TCP/IP Sockets
K
A
DAK
211
kn_select kn_select
Purpose Select Sockets Ready for Receive or Send
Used by
n Task o ISP o Timer Procedure o Restart Procedure o Exit Procedure
Setup Prototype is in file KN_SOCK.H.
#include "KN_SOCK.H"
int kn_select(int nfds, fd_set *readfds,
fd_set *writefds,
fd_set *exceptfds,
struct timeval *timeout);
Description Nfds indicates the number of sequential socket descriptors which are to be
examined in each descriptor set. Since socket descriptors are numbered
sequentially from 0, parameter nfds must be the numerically largest
socket descriptor value, plus one. For convenience, you can set
nfds to
KN_MAX_SOCKET and KwikNet will examine all sockets identified in each
descriptor set.
Readfds is a pointer to a descriptor set which, on entry, identifies the
sockets to be interrogated. Upon return, the descriptor set at *readfds
will be updated to identify which of the interrogated sockets have
received data ready to be read. A socket will also be declared ready to
read if an error other than EINPROGRESS or EWOULDBLOCK is recorded in
the socket while the socket is selected. Set this parameter to NULL to
ignore sockets which are ready to be read.
Writefds is a pointer to a descriptor set which, on entry, identifies the
sockets to be interrogated. Upon return, the descriptor set at
*writefds will be updated to identify which of the interrogated
sockets have space available, making the socket ready for sending more
data. A socket will also be declared ready for sending if an error other
than EINPROGRESS is recorded in the socket while the socket is
selected. Set this parameter to
NULL to ignore sockets which are ready
for sending.
Exceptfds is a pointer to a descriptor set which, on entry, identifies the
sockets to be interrogated. Upon return, the descriptor set at
*exceptfds will be updated to identify which of the interrogated
sockets have outstanding exceptions present.
KwikNet treats recorded
errors other than EINPROGRESS and EWOULDBLOCK as exceptions.
KwikNet also reports an exception if out-of-band data has been received.
Set exceptfds to NULL to ignore sockets with outstanding exceptions.
...more