NAME

catsettimeout - set timout for read fds

SYNOPSIS

#include <cat/cat.h>

int catnet_settimeout(cat_session *session, int mseconds);

DESCRIPTION

This function sets the timeout for the CAT_SERVER_RFD and CAT_CLIENT_RFD descriptors when reading or waiting for network data.

mseconds is the timeout in milliseconds. A negative value means that reads will never timeout. A value of 0 (zero) will make the session non-blocking, causing read operations to return immediately if no data is available. The TCP/IP I/O handler will return CAT_TIMEOUT in the event of a timeout.

RETURN VALUES

The function returns the old timeout value (in milliseconds) or a value less than -1 in the event of an error. Note that -1 means infinite timeout and is therefore a valid return value.

SEE ALSO

cat, catnet