Watt-32 tcp/ip  2.2 dev-rel.10
Functions | Variables
select.c File Reference

Go to the source code of this file.


static int read_select (int s, Socket *socket)
static int write_select (int s, Socket *socket)
static int exc_select (int s, Socket *socket)
static __inline Socketsetup_select (int s, BOOL first_loop)
int W32_CALL select_s (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
 The select_s() function. More...
int W32_CALL select (int nfds, fd_set *read_fds, fd_set *write_fds, fd_set *except_fds, struct timeval *timeout)
int pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timespec *timeout, const sigset_t *sigmask)
static __inline int listen_queued (Socket *socket)
static __inline int sock_signalled (Socket *socket, int mask)
static BOOL handle_ready (int hnd)
void usage (const char *argv0)
char * fd_set_str (char *buf, size_t len, const fd_set *fd)
void select_dump (int sock_err, int num_fd, const struct timeval *tv, const fd_set *fd_read, const fd_set *fd_write, const fd_set *fd_except)
int main (int argc, char **argv)


static struct timeval sel_min_block = { 0, 500000 }
 The smallest time for not yielding or calling tcp_tick(). More...

Detailed Description

BSD select().

Definition in file select.c.

Function Documentation

static int exc_select ( int  s,
Socket socket 
Only arrival of OOB-data should count here

Definition at line 624 of file select.c.

int W32_CALL select_s ( int  nfds,
fd_set readfds,
fd_set writefds,
fd_set exceptfds,
struct timeval timeout 

The select_s() function.

It supports more sockets than would fit in a fd_set. I.e. it handles an array of 'fd_set's on input/output. Thus it is the user's responsibilty to not use a too high 'nfds' value. I.e. If nfs > 512*8 and user fd_set's on input is smaller than 512*, select_s() could trash the fd_set's on output.

Clear our "working" fd_sets.

Don't use FD_ZERO() since our working fd_sets contain more than FD_SETSIZE sockets.

Definition at line 112 of file select.c.

References _sock_crit_start(), _sock_crit_stop(), exc_select(), and tcp_tick().

Variable Documentation

struct timeval sel_min_block = { 0, 500000 }

The smallest time for not yielding or calling tcp_tick().

Should be configurable.

Definition at line 68 of file select.c.