AN_SET_BLOCKING(3)

NAME

an_set_blocking - set whether sockets should wait for IO

SYNOPSIS

#include <antinat.h>

int an_set_blocking(ANCONN s, unsigned short blockingstatus);

DESCRIPTION

The an_set_blocking(3) function is used to switch sockets between blocking and non-blocking mode. In blocking mode, calls to read data from a socket will wait until some data is available to be read; in nonblocking mode, these calls will return immediately with an error condition. The only parts of the library which currently support non-blocking operation are in an_recv(3) and an_send(3). Currently, all other calls will silently switch to blocking mode, perform the operation, then switch back to the original blocking status. In order to switch to blocking mode, specify a zero parameter for blockingstatus. Use a non-zero parameter for non-blocking mode. Blocking mode is the default for all sockets.

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

blockingstatus is set to zero to switch the socket into blocking mode, or non-zero to set into non-blocking mode.

RETURN VALUE

This call returns AN_ERROR_SUCCESS to indicate successful completion.

ERRORS

There is no error return.

SEE ALSO

an_new_connection(3)

AUTHOR

Malcolm Smith <malxau@users.sourceforge.net>