#include "ttt.h"
-typedef void (*ttt_socket_dispatch_func_t) (int connected_socket);
+typedef void (*ttt_socket_accept_func_t) (void *closure,
+ int connected_socket);
/* Create a socket, bind it to the given host and port, and listen in
* preparation for incoming connections. See ttt_socket_accept for a
/* Wait for an incoming connection on listen_socket, (which should be
* a valid socket on which bind and listen have already been
- * called---see ttt_socket_create_server), then call the dispatch
- * function with the new socket from the connection.
+ * called---see ttt_socket_create_server), then call the accept
+ * function with the closure argument and the new socket from the
+ * connection.
*/
void
-ttt_socket_accept (int listen_socket, ttt_socket_dispatch_func_t dispatch);
+ttt_socket_accept (int listen_socket,
+ ttt_socket_accept_func_t accept,
+ void *closure);
#endif