#include#include int socket_create(int mode, string read_callback, string|void close_callback)
The argument read_callback is the name of a function for the driver to call when the socket gets data from its peer. The read callback should follow this format:
void read_callback(int fd, mixed message)
Where fd is the socket which received the data, and message is the data which was received.
The argument close_callback is the name of a function for the driver to call if the socket closes unexpectedly, i.e. not as the result of a socket_close(3) call. The close callback 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.