aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_stream_lib.h
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2012-02-26 22:31:40 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2012-02-26 22:31:40 +0000
commit9cd78fb24282746e988cf768430082ca2e17a82c (patch)
tree073fa222760da6b14807b6c5411c901fa03147ec /src/include/gnunet_stream_lib.h
parent10cf59ba4f31f690798e8d36a0a29383caee26ab (diff)
downloadgnunet-9cd78fb24282746e988cf768430082ca2e17a82c.tar.gz
gnunet-9cd78fb24282746e988cf768430082ca2e17a82c.zip
-added seperate io handles for read and write
Diffstat (limited to 'src/include/gnunet_stream_lib.h')
-rw-r--r--src/include/gnunet_stream_lib.h28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/include/gnunet_stream_lib.h b/src/include/gnunet_stream_lib.h
index 7ac0f5d96..930cc1d3d 100644
--- a/src/include/gnunet_stream_lib.h
+++ b/src/include/gnunet_stream_lib.h
@@ -206,12 +206,17 @@ typedef void (*GNUNET_STREAM_CompletionContinuation) (void *cls,
206 206
207 207
208/** 208/**
209 * Handle to cancel IO operations. 209 * Handle to cancel IO write operations.
210 */ 210 */
211struct GNUNET_STREAM_IOHandle; 211struct GNUNET_STREAM_IOWriteHandle;
212 212
213 213
214/** 214/**
215 * Handle to cancel IO read operations.
216 */
217struct GNUNET_STREAM_IOReadHandle;
218
219/**
215 * Tries to write the given data to the stream 220 * Tries to write the given data to the stream
216 * 221 *
217 * @param socket the socket representing a stream 222 * @param socket the socket representing a stream
@@ -222,7 +227,7 @@ struct GNUNET_STREAM_IOHandle;
222 * @param write_cont_cls the closure 227 * @param write_cont_cls the closure
223 * @return handle to cancel the operation; NULL if a previous write is pending 228 * @return handle to cancel the operation; NULL if a previous write is pending
224 */ 229 */
225struct GNUNET_STREAM_IOHandle * 230struct GNUNET_STREAM_IOWriteHandle *
226GNUNET_STREAM_write (struct GNUNET_STREAM_Socket *socket, 231GNUNET_STREAM_write (struct GNUNET_STREAM_Socket *socket,
227 const void *data, 232 const void *data,
228 size_t size, 233 size_t size,
@@ -257,20 +262,29 @@ typedef size_t (*GNUNET_STREAM_DataProcessor) (void *cls,
257 * @param proc_cls the closure for proc 262 * @param proc_cls the closure for proc
258 * @return handle to cancel the operation 263 * @return handle to cancel the operation
259 */ 264 */
260struct GNUNET_STREAM_IOHandle * 265struct GNUNET_STREAM_IOReadHandle *
261GNUNET_STREAM_read (const struct GNUNET_STREAM_Socket *socket, 266GNUNET_STREAM_read (struct GNUNET_STREAM_Socket *socket,
262 struct GNUNET_TIME_Relative timeout, 267 struct GNUNET_TIME_Relative timeout,
263 GNUNET_STREAM_DataProcessor proc, 268 GNUNET_STREAM_DataProcessor proc,
264 void *proc_cls); 269 void *proc_cls);
265 270
266 271
267/** 272/**
268 * Cancel pending read or write operation. 273 * Cancel pending write operation.
274 *
275 * @param ioh handle to operation to cancel
276 */
277void
278GNUNET_STREAM_io_write_cancel (struct GNUNET_STREAM_IOWriteHandle *ioh);
279
280
281/**
282 * Cancel pending read operation.
269 * 283 *
270 * @param ioh handle to operation to cancel 284 * @param ioh handle to operation to cancel
271 */ 285 */
272void 286void
273GNUNET_STREAM_io_cancel (struct GNUNET_STREAM_IOHandle *ioh); 287GNUNET_STREAM_io_read_cancel (struct GNUNET_STREAM_IOReadHandle *ioh);
274 288
275 289
276#if 0 290#if 0