1. ssssoooocccckkkkeeeetttt____ccccrrrreeeeaaaatttteeee((((3333)))) MMMMuuuuddddOOOOSSSS ((((5555 SSSSeeeepppp 1111999999994444)))) ssssoooocccckkkkeeeetttt____ccccrrrreeeeaaaatttteeee((((3333))))
    2. NNNNAAAAMMMMEEEE
    3. socket_create() - create an efun socket
    4. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
    5. #include <socket_err.h>
    6. int socket_create( int mode, string read_callback,
    7. void | string close_callback );
    8. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
    9. socket_create() creates an efun socket. mode determines
    10. which type of socket is created. Currently supported socket
    11. modes are:
    12. MUD for sending LPC data types using TCP protocol.
    13. STREAM for sending raw data using TCP protocol.
    14. DATAGRAM for using UDP protocol.
    15. The argument read_callback is the name of a function for the
    16. driver to call when the socket gets data from its peer. The
    17. read callback should follow this format:
    18. void read_callback(int fd, mixed message)
    19. Where fd is the socket which received the data, and message
    20. is the data which was received.
    21. The argument close_callback is the name of a function for
    22. the driver to call if the socket closes unexpectedly, i.e.
    23. not as the result of a socket_close(3) call. The close
    24. callback should follow this format:
    25. void close_callback(int fd)
    26. Where fd is the socket which has closed. NOTE:
    27. close_callback is not used with DATAGRAM mode sockets.
    28. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSS
    29. socket_create() returns:
    30. a non-negative descriptor on success.
    31. a negative value indicated below on error.
    32. EEEERRRRRRRROOOORRRRSSSS
    33. EEMODENOTSUPP Socket mode not supported.
    34. Page 1 (Writen 5/23/97)
    35. ssssoooocccckkkkeeeetttt____ccccrrrreeeeaaaatttteeee((((3333)))) MMMMuuuuddddOOOOSSSS ((((5555 SSSSeeeepppp 1111999999994444)))) ssssoooocccckkkkeeeetttt____ccccrrrreeeeaaaatttteeee((((3333))))
    36. EESOCKET Problem creating socket.
    37. EESETSOCKOPT Problem with setsockopt.
    38. EENONBLOCK Problem setting non-blocking mode.
    39. EENOSOCKS No more available efun sockets.
    40. EESECURITY Security violation attempted.
    41. SSSSEEEEEEEE AAAALLLLSSSSOOOO
    42. socket_accept(3), socket_bind(3), socket_close(3),
    43. socket_connect(3), socket_listen(3), socket_write(3)
    44. Page 2 (Writen 5/23/97)