ssssoooocccckkkkeeeetttt____lllliiiisssstttteeeennnn((((3333)))) MMMMuuuuddddOOOOSSSS ((((5555 SSSSeeeepppp 1111999999994444)))) ssssoooocccckkkkeeeetttt____lllliiiisssstttteeeennnn((((3333))))NNNNAAAAMMMMEEEEsocket_listen() - listen for connections on a socketSSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS#include <socket_err.h>int socket_listen( int s, string listen_callback );DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNTo accept connections, a socket is first created withsocket_create(3), the socket is them put into listening modewith socket_listen(3), and the connections are accepted withsocket_accept(3). The socket_listen() call applies only tosockets of type STREAM or MUD.The argument listen_callback is the name of a function forthe driver to call when a connection is requested on thelistening socket. The listen callback should follow thisformat:void listen_callback(int fd)Where fd is the listening socket.RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSSsocket_listen() returns:EESUCCESS on success.a negative value indicated below on error.EEEERRRRRRRROOOORRRRSSSSEEFDRANGE Descriptor out of range.EEBADF Descriptor is invalid.EESECURITY Security violation attempted.EEMODENOTSUPP Socket mode not supported.EENOADDR Socket not bound to an address.EEISCONN Socket is already connected.EELISTEN Problem with listen.SSSSEEEEEEEE AAAALLLLSSSSOOOOPage 1 (Writen 5/23/97)ssssoooocccckkkkeeeetttt____lllliiiisssstttteeeennnn((((3333)))) MMMMuuuuddddOOOOSSSS ((((5555 SSSSeeeepppp 1111999999994444)))) ssssoooocccckkkkeeeetttt____lllliiiisssstttteeeennnn((((3333))))socket_accept(3), socket_connect(3), socket_create(3)Page 2 (Writen 5/23/97)
