lpc4/lib/
lpc4/lib/doc/efun/
lpc4/lib/doc/lfun/
lpc4/lib/doc/operators/
lpc4/lib/doc/simul_efuns/
lpc4/lib/doc/types/
lpc4/lib/etc/
lpc4/lib/include/
lpc4/lib/include/arpa/
lpc4/lib/obj/d/
lpc4/lib/save/
lpc4/lib/secure/
lpc4/lib/std/
lpc4/lib/std/living/
NAME
	socket_release - release ownership of a socket to another object

SYNOPSIS
	int socket_release(int socket, function release_callback );

DESCRIPTION
	socket_release() is used to change ownership (and control) of a socket
	to another object.  It is useful in daemon objects (like inetd) which
	handle connection set-up and then transfer a connected socket to
	another object for further processing.

	Socket ownership transfer involves a handshake between the current
	owner object and the socket to which the current owner wishes to
	transfer the socket.  The handshake is initiated when
	socket_release() is called. socket_release() does appropriate
	security/integrity checking and then calls the release_callback
	function. This function is used to notify the object that 
	release_callback is in that socket ownership is being transferred
	to it.  It is then it's	responsibility to call socket_acquire()
	within the release callback function.  If socket_acquire() is called
	then the handshake is complete and socket ownership has been
	successfully transferred to that object. The object may decline to
	accept responsibility for the socket by not calling
	socket_acquire(), in which case ownership does not change and the
	current socket owner must decide how to respond to this.

	If the socket owner is successfully transfered then socket_release()
	returns EESUCCESS.  If ob does not accept ownership for the socket then
	EESOCKNOTRLSD is returned.  Other errors can be returned based on
	security violation, bad socket descriptor vbalues, etc.

SEE ALSO
	socket_acquire