NAME

catnat_connect - create a connection to a specified destination

SYNOPSIS

#include <cat/cat.h>

int catnet_connect(cat_session *session, const char *dest, int fd_ids);

DESCRIPTION

This function creates a connection to the specified destination and maps the given fd_ids to that channel. If fd_ids is specified as 0, it defaults to the SERVER descriptors. Destination dest should be in the format "tcp:host:port", where host is either an IP address (in dotted-decimal format) or a host name, and port is a port number or a service name.

If the session already uses any of the descriptors in fd_ids, these will be closed after a successful connection.

The function returns CAT_OK if successful, or a negative code on error.

SEE ALSO

cat, catnet