From d986f2c7460120ffc3f199b29a06126d0b97b75b Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 30 Aug 2009 20:48:51 +0000 Subject: adding convenience API --- src/include/gnunet_client_lib.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/include') diff --git a/src/include/gnunet_client_lib.h b/src/include/gnunet_client_lib.h index 8651b273c..d391aed2b 100644 --- a/src/include/gnunet_client_lib.h +++ b/src/include/gnunet_client_lib.h @@ -119,6 +119,30 @@ struct GNUNET_CONNECTION_TransmitHandle notify, void *notify_cls); + +/** + * Convenience API that combines sending a request + * to the service and waiting for a response. + * If either operation times out, the callback + * will be called with a "NULL" response (in which + * case the connection should probably be destroyed). + * + * @param sock connection to use + * @param hdr message to transmit + * @param timeout when to give up (for both transmission + * and for waiting for a response) + * @param rn function to call with the response + * @param rn_cls closure for rn + */ +void +GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection *sock, + const struct GNUNET_MessageHeader *hdr, + struct GNUNET_TIME_Relative timeout, + GNUNET_CLIENT_MessageHandler rn, + void *rn_cls); + + + /** * Request that the service should shutdown. * Afterwards, the connection should be disconnected. -- cgit v1.2.3