ssssoooocccckkkkeeeetttt____aaaaccccqqqquuuuiiiirrrreeee((((3333)))) MMMMuuuuddddOOOOSSSS ((((5555 SSSSeeeepppp 1111999999994444)))) ssssoooocccckkkkeeeetttt____aaaaccccqqqquuuuiiiirrrreeee((((3333))))NNNNAAAAMMMMEEEEsocket_acquire() - assume ownership of a socketSSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS#include <socket_err.h>int socket_acquire( int socket, string read_callback,string write_callback,string close_callback );DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNsocket_acquire() is called to complete the handshake begunby socket_release() for transferring ownership (and control)of a socket to a new object. socket_release() calls therelease callback function within the new owner object tonotify the object that it wishes to pass control of thesocket on. It is the responsibility of the new owner socketto decide whether it wishes to accept the socket. It itdoes, then socket_acquire() is called to complete thetransfer. If not, then the callback simply returns withoutcompleting the handshake.In the former case the handshake is completed and the newobject becomes the socket owner. The read, write and closecallback function parameters refer to functions within thenew object. These are specified so that the MudOS driverwill know which functions to call within the new object.Decling to acquire the socket will cause socket_release() toreturn EESOCKNOTRLSD so the owner can perform appropriateclean-up.socket_acquire() may only be called within the context ofthr release callback function and only with the socketspecified.SSSSEEEEEEEE AAAALLLLSSSSOOOOsocket_release(3)Page 1 (Writen 5/23/97)
