#include <cat/gen.h>
int catgen_newport(cat_session **sessp, const char *portspec);
-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.
catgen_getopt, catgen_parseargs, catgen_run, catgen_server