NAME

catnet_iohandler - get the TCP/IP I/O handler

SYNOPSIS

#include <cat/cat.h>

const cat_iohandler *catnet_iohandler(int *error);

DESCRIPTION

catnet_iohandler() returns the I/O handler for TCP/IP. The I/O handler is installed by calling cat_installiohandler(), with the return value from catnet_iohandler() as the second argument and NULL as the third.

On error, the function returns NULL and the error code is stored in *error if that argument is non-NULL. The catnet_iohandler function is not likely to fail once cat_init() has been called.

All other catnet_ functions expect this I/O handler to be installed in the given session. In the event that no I/O handler or another I/O handler is installed, a negative error code will be returned in error.

EXAMPLE

The typical sequence for creating a new network session is:

 cat_session *sess;

 sess = cat_newsession();
 cat_installiohandler(sess, catnet_iohandler(NULL), NULL);

SEE ALSO

cat, catnet, cat_installiohandler