X-Git-Url: https://git.cworth.org/git?p=ttt;a=blobdiff_plain;f=src%2Fttt-socket.h;h=c3ca0bdd604263e65e49af91f1a106ad36b79b03;hp=6b35ef23649111dca03457b95925b4640b075ab6;hb=7de44ed398081656115dce6db7d0a04c1a50bb34;hpb=b95a33abda8faac3638691dde70de0d59fadb30f diff --git a/src/ttt-socket.h b/src/ttt-socket.h index 6b35ef2..c3ca0bd 100644 --- a/src/ttt-socket.h +++ b/src/ttt-socket.h @@ -55,7 +55,25 @@ 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 +/* Create a socket, and connect it to the given host and port, + * returing it in socket_ret. + * + * Lookup for host (e.g. /etc/hosts and DNS) and port (e.g /etc/services) + * will be performed if necessary. + * + * Return value: TTT_STATUS_SUCCESS if successful. + * TTT_STATUS_CONNECTION_REFUSED: no server listening. + * TTT_STATUS_NETWORK_UNREACHABLE: + * + * Errors: If any error other than those listed above occurs, this + * function will not return. + */ +ttt_status_t +ttt_socket_create_client (const char *host, + const char *port, + int *socket_ret); + +/* Perform 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.