X-Git-Url: https://git.cworth.org/git?p=ttt;a=blobdiff_plain;f=src%2Fttt-socket.h;h=6b35ef23649111dca03457b95925b4640b075ab6;hp=909501e0e37880c0f44d178d12e5d71b069b058d;hb=15672ac8305a1c5ba0d9bf6edabb0a194c30628e;hpb=5d56d3cd8b4685e905ed604277ac9cb32c876127 diff --git a/src/ttt-socket.h b/src/ttt-socket.h index 909501e..6b35ef2 100644 --- a/src/ttt-socket.h +++ b/src/ttt-socket.h @@ -55,4 +55,24 @@ ttt_socket_accept (int listen_socket, ttt_socket_accept_func_t accept, void *closure); +/* Performa a blocking read, until all count bytes are read from the + * socket to buf, which must be of size count or larger. + * + * Errors: If any errors occur, this function does not return. + */ +void +ttt_socket_read (int socket, + void *buf, + size_t count); + +/* Perform a blocking write, until all count bytes are written from + * buf to the socket. + * + * Errors: If any errors occur, this function does not return. + */ +void +ttt_socket_write (int socket, + const void *buf, + size_t count); + #endif