X-Git-Url: https://git.cworth.org/git?p=ttt;a=blobdiff_plain;f=src%2Fttt-socket.h;h=909501e0e37880c0f44d178d12e5d71b069b058d;hp=59e89a514b6fd1d2d92af21cfe1e9f4dba2e2eb6;hb=5d56d3cd8b4685e905ed604277ac9cb32c876127;hpb=ded32923a25488449be27687013845d7fa0e9e5e diff --git a/src/ttt-socket.h b/src/ttt-socket.h index 59e89a5..909501e 100644 --- a/src/ttt-socket.h +++ b/src/ttt-socket.h @@ -24,7 +24,8 @@ #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 @@ -45,10 +46,13 @@ ttt_socket_create_server (const char *host, const char *port); /* 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