ssssoooocccckkkkeeeetttt____ccccoooonnnnnnnneeeecccctttt((((3333)))) MMMMuuuuddddOOOOSSSS ((((5555 SSSSeeeepppp 1111999999994444)))) ssssoooocccckkkkeeeetttt____ccccoooonnnnnnnneeeecccctttt((((3333))))NNNNAAAAMMMMEEEEsocket_connect() - initiate a connection on a socketSSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS#include <socket_err.h>int socket_connect( int s, string address,string read_callback,string write_callback );DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNThe argument s is a socket. s must be either a STREAM modeor a MUD mode socket. address is the address to which thesocket will attempt to connect. address is of the form:"127.0.0.1 23"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 write_callback is the name of a function forthe driver to call when the socket is ready to be writtento. The write callback should follow this format:void write_callback(int fd)Where fd is the socket which is ready to be written to.RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSSsocket_connect() 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.Page 1 (Writen 5/23/97)ssssoooocccckkkkeeeetttt____ccccoooonnnnnnnneeeecccctttt((((3333)))) MMMMuuuuddddOOOOSSSS ((((5555 SSSSeeeepppp 1111999999994444)))) ssssoooocccckkkkeeeetttt____ccccoooonnnnnnnneeeecccctttt((((3333))))EEISLISTEN Socket is listening.EEISCONN Socket is already connected.EEBADADDR Problem with address format.EEINTR Interrupted system call.EEADDRINUSE Address already in use.EEALREADY Operation already in progress.EECONNREFUSED Connection refused.EECONNECT Problem with connect.SSSSEEEEEEEE AAAALLLLSSSSOOOOsocket_accept(3), socket_close(3), socket_create(3)Page 2 (Writen 5/23/97)
