1. ssssoooocccckkkkeeeetttt____ccccoooonnnnnnnneeeecccctttt((((3333)))) MMMMuuuuddddOOOOSSSS ((((5555 SSSSeeeepppp 1111999999994444)))) ssssoooocccckkkkeeeetttt____ccccoooonnnnnnnneeeecccctttt((((3333))))
    2. NNNNAAAAMMMMEEEE
    3. socket_connect() - initiate a connection on a socket
    4. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
    5. #include <socket_err.h>
    6. int socket_connect( int s, string address,
    7. string read_callback,
    8. string write_callback );
    9. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
    10. The argument s is a socket. s must be either a STREAM mode
    11. or a MUD mode socket. address is the address to which the
    12. socket will attempt to connect. address is of the form:
    13. "127.0.0.1 23"
    14. The argument read_callback is the name of a function for the
    15. driver to call when the socket gets data from its peer. The
    16. read callback should follow this format:
    17. void read_callback(int fd, mixed message)
    18. Where fd is the socket which received the data, and message
    19. is the data which was received.
    20. The argument write_callback is the name of a function for
    21. the driver to call when the socket is ready to be written
    22. to. The write callback should follow this format:
    23. void write_callback(int fd)
    24. Where fd is the socket which is ready to be written to.
    25. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSS
    26. socket_connect() returns:
    27. EESUCCESS on success.
    28. a negative value indicated below on error.
    29. EEEERRRRRRRROOOORRRRSSSS
    30. EEFDRANGE Descriptor out of range.
    31. EEBADF Descriptor is invalid.
    32. EESECURITY Security violation attempted.
    33. EEMODENOTSUPP Socket mode not supported.
    34. Page 1 (Writen 5/23/97)
    35. ssssoooocccckkkkeeeetttt____ccccoooonnnnnnnneeeecccctttt((((3333)))) MMMMuuuuddddOOOOSSSS ((((5555 SSSSeeeepppp 1111999999994444)))) ssssoooocccckkkkeeeetttt____ccccoooonnnnnnnneeeecccctttt((((3333))))
    36. EEISLISTEN Socket is listening.
    37. EEISCONN Socket is already connected.
    38. EEBADADDR Problem with address format.
    39. EEINTR Interrupted system call.
    40. EEADDRINUSE Address already in use.
    41. EEALREADY Operation already in progress.
    42. EECONNREFUSED Connection refused.
    43. EECONNECT Problem with connect.
    44. SSSSEEEEEEEE AAAALLLLSSSSOOOO
    45. socket_accept(3), socket_close(3), socket_create(3)
    46. Page 2 (Writen 5/23/97)