NAME

catgen_newport - create a listener session

SYNOPSIS

#include <cat/gen.h>

int catgen_newport(cat_session **sessp, const char *portspec);

DESCRIPTION

This function creates a new session that listens to the port specification in portspec. The portspec argument should have the appearance of a string given to a -P command line argument, as described in catgen.

On successful return, *sessp will point to an initialized listener session. It is up to the caller of this function to close the newly created session with either cat_close() or letting the session be managed by the framework by a call to catsock_add(), in which case the session will be closed automatically.

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

SEE ALSO

cat, catgen

catgen_getopt, catgen_parseargs, catgen_run, catgen_server