AN_FD_SET(3)

NAME

AN_FD_SET - place an Antinat connection handle into a socket set.

SYNOPSIS

#include <antinat.h>

int AN_FD_SET(ANCONN s, struct fd_set * fds, int top);

DESCRIPTION

The AN_FD_SET(3) function inserts an Antinat socket into a set of file descriptors. This set of file descriptors can be used with select. Use the AN_FD_ISSET(3) function to determine if a file descriptor is in the set, or AN_FD_CLR(3) to remove the file descriptor from the set. This function should be considered equivalent to the FD_SET(3) macro in your sockets library, except that it is for use with proxy-capable sockets, and supports an extension for determining the highest numbered file descriptor.

s is a socket previously created with an_new_connection(3).

fds is an fd_set socket structure. Consult your platform's documentation for the select function for more information about this structure. It will contain a list of file descriptors suitable for use with the select call.

top is the previous highest numbered file descriptor. Select requires the highest numbered file descriptor in a set. The highest numbered file descriptor will be returned, and this may be larger than the top value if required to accommodate the freshly inserted file descriptor.

RETURN VALUE

The return value is the highest numbered file descriptor in the set. This value is required by select.

ERRORS

There is no error return.

SEE ALSO

select, AN_FD_CLR(3), AN_FD_ISSET(3), an_new_connection(3)

AUTHOR

Malcolm Smith <malxau@users.sourceforge.net>