ssssoooocccckkkkeeeetttt____ccccrrrreeeeaaaatttteeee((((3333)))) MMMMuuuuddddOOOOSSSS ((((5555 SSSSeeeepppp 1111999999994444)))) ssssoooocccckkkkeeeetttt____ccccrrrreeeeaaaatttteeee((((3333))))NNNNAAAAMMMMEEEEsocket_create() - create an efun socketSSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS#include <socket_err.h>int socket_create( int mode, string read_callback,void | string close_callback );DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNsocket_create() creates an efun socket. mode determineswhich type of socket is created. Currently supported socketmodes are:MUD for sending LPC data types using TCP protocol.STREAM for sending raw data using TCP protocol.DATAGRAM for using UDP protocol.The argument read_callback is the name of a function for thedriver to call when the socket gets data from its peer. Theread callback should follow this format:void read_callback(int fd, mixed message)Where fd is the socket which received the data, and messageis the data which was received.The argument close_callback is the name of a function forthe driver to call if the socket closes unexpectedly, i.e.not as the result of a socket_close(3) call. The closecallback should follow this format:void close_callback(int fd)Where fd is the socket which has closed. NOTE:close_callback is not used with DATAGRAM mode sockets.RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSSsocket_create() returns:a non-negative descriptor on success.a negative value indicated below on error.EEEERRRRRRRROOOORRRRSSSSEEMODENOTSUPP Socket mode not supported.Page 1 (Writen 5/23/97)ssssoooocccckkkkeeeetttt____ccccrrrreeeeaaaatttteeee((((3333)))) MMMMuuuuddddOOOOSSSS ((((5555 SSSSeeeepppp 1111999999994444)))) ssssoooocccckkkkeeeetttt____ccccrrrreeeeaaaatttteeee((((3333))))EESOCKET Problem creating socket.EESETSOCKOPT Problem with setsockopt.EENONBLOCK Problem setting non-blocking mode.EENOSOCKS No more available efun sockets.EESECURITY Security violation attempted.SSSSEEEEEEEE AAAALLLLSSSSOOOOsocket_accept(3), socket_bind(3), socket_close(3),socket_connect(3), socket_listen(3), socket_write(3)Page 2 (Writen 5/23/97)
