diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-08-30 20:48:51 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-08-30 20:48:51 +0000 |
commit | d986f2c7460120ffc3f199b29a06126d0b97b75b (patch) | |
tree | 5f8d7f3e3461db2b3959bcc9bf434aa81e0515d2 /src/include/gnunet_client_lib.h | |
parent | 485f20f1de5adbbb0ab05b42aaced78feb9bf58c (diff) | |
download | gnunet-d986f2c7460120ffc3f199b29a06126d0b97b75b.tar.gz gnunet-d986f2c7460120ffc3f199b29a06126d0b97b75b.zip |
adding convenience API
Diffstat (limited to 'src/include/gnunet_client_lib.h')
-rw-r--r-- | src/include/gnunet_client_lib.h | 24 |
1 files changed, 24 insertions, 0 deletions
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 | |||
119 | notify, void *notify_cls); | 119 | notify, void *notify_cls); |
120 | 120 | ||
121 | 121 | ||
122 | |||
123 | /** | ||
124 | * Convenience API that combines sending a request | ||
125 | * to the service and waiting for a response. | ||
126 | * If either operation times out, the callback | ||
127 | * will be called with a "NULL" response (in which | ||
128 | * case the connection should probably be destroyed). | ||
129 | * | ||
130 | * @param sock connection to use | ||
131 | * @param hdr message to transmit | ||
132 | * @param timeout when to give up (for both transmission | ||
133 | * and for waiting for a response) | ||
134 | * @param rn function to call with the response | ||
135 | * @param rn_cls closure for rn | ||
136 | */ | ||
137 | void | ||
138 | GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection *sock, | ||
139 | const struct GNUNET_MessageHeader *hdr, | ||
140 | struct GNUNET_TIME_Relative timeout, | ||
141 | GNUNET_CLIENT_MessageHandler rn, | ||
142 | void *rn_cls); | ||
143 | |||
144 | |||
145 | |||
122 | /** | 146 | /** |
123 | * Request that the service should shutdown. | 147 | * Request that the service should shutdown. |
124 | * Afterwards, the connection should be disconnected. | 148 | * Afterwards, the connection should be disconnected. |