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_acquire() - assume ownership of a socket

SYNOPSIS
	int socket_acquire(int socket, function read_callback,
		function write_callback,function close_callback);

DESCRIPTION
	socket_acquire() is called to complete the handshake begun by
	socket_release() for transferring ownership (and control) of a
	socket to a new object. socket_release() calls the release callback
	function within the new owner object to notify the object that it
	wishes to pass control of the socket on. It is the responsibility
	of the new owner socket to decide whether it wishes to accept the
	socket. It it does, then socket_acquire() is called to complete the
	transfer.  If not, then the callback simply returns without
	completing the handshake.

	In the former case the handshake is completed and the new object
	becomes the socket owner. The read, write and close callback function
	parameters refer to functions within the new object. These are
	specified so that the MudOS driver will know which functions to call
	within the newobject. Decling to acquire the socket will cause
	socket_release() to return EESOCKNOTRLSD so the owner can perform
	appropriate clean-up.

	socket_acquire() may only be called within the context of the release
	callback function and only with the socket specified.

SEE ALSO
	socket_release