CH_ALLOC_PORT(3)

FUNCTION
ch_alloc_port - Allocate a port.

SYNOPSIS
#include <karma_ch.h>

Channel * ch_alloc_port

(unsigned int *port_number, unsigned int retries, unsigned int *num_docks)

DESCRIPTION
This routine will allocate a Karma port for the module so that it can operate as a server (able to receive network connections).

port_number
    A pointer to the port number to allocate. The routine will write the actual port number allocated to this address. This must point to an address which lies on an <<int>> boundary.

retries
    The number of succsessive port numbers to attempt to allocate before giving up. If this is 0, then the routine will give up immediately if the specified port number is in use.

num_docks
    The routine will create a number of docks for one port. Each dock is an alternative access point for other modules to connect to this port. The number of docks allocated will be written here. This must point to an address which lies on an <<int>> boundary.

RETURN VALUE
A pointer to an array of channel docks on success, else NULL.

Multi-threading Level
Unsafe.

NOTES
The close-on-exec flags of the docks are set such that the docks will close on a call to execve(2V).

The docks are placed into blocking mode.

AUTHOR
Richard Gooch (rgooch@atnf.csiro.au)

AVAILABLITY
The Karma Distribution is available for anonymous ftp from: ftp://ftp.atnf.csiro.au/pub/software/karma/ ftp://wuarchive.wustl.edu/graphics/graphics/packages/karma/ ftp://ftp.pwr.wroc.pl/pub/karma/ The Karma Home Page is: http://www.atnf.csiro.au/karma/