From 9cd78fb24282746e988cf768430082ca2e17a82c Mon Sep 17 00:00:00 2001 From: Sree Harsha Totakura Date: Sun, 26 Feb 2012 22:31:40 +0000 Subject: [PATCH] -added seperate io handles for read and write --- src/include/gnunet_stream_lib.h | 28 +++++++++++++++++++++------- 1 file 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,11 +206,16 @@ typedef void (*GNUNET_STREAM_CompletionContinuation) (void *cls, /** - * Handle to cancel IO operations. + * Handle to cancel IO write operations. */ -struct GNUNET_STREAM_IOHandle; +struct GNUNET_STREAM_IOWriteHandle; +/** + * Handle to cancel IO read operations. + */ +struct GNUNET_STREAM_IOReadHandle; + /** * Tries to write the given data to the stream * @@ -222,7 +227,7 @@ struct GNUNET_STREAM_IOHandle; * @param write_cont_cls the closure * @return handle to cancel the operation; NULL if a previous write is pending */ -struct GNUNET_STREAM_IOHandle * +struct GNUNET_STREAM_IOWriteHandle * GNUNET_STREAM_write (struct GNUNET_STREAM_Socket *socket, const void *data, size_t size, @@ -257,20 +262,29 @@ typedef size_t (*GNUNET_STREAM_DataProcessor) (void *cls, * @param proc_cls the closure for proc * @return handle to cancel the operation */ -struct GNUNET_STREAM_IOHandle * -GNUNET_STREAM_read (const struct GNUNET_STREAM_Socket *socket, +struct GNUNET_STREAM_IOReadHandle * +GNUNET_STREAM_read (struct GNUNET_STREAM_Socket *socket, struct GNUNET_TIME_Relative timeout, GNUNET_STREAM_DataProcessor proc, void *proc_cls); /** - * Cancel pending read or write operation. + * Cancel pending write operation. + * + * @param ioh handle to operation to cancel + */ +void +GNUNET_STREAM_io_write_cancel (struct GNUNET_STREAM_IOWriteHandle *ioh); + + +/** + * Cancel pending read operation. * * @param ioh handle to operation to cancel */ void -GNUNET_STREAM_io_cancel (struct GNUNET_STREAM_IOHandle *ioh); +GNUNET_STREAM_io_read_cancel (struct GNUNET_STREAM_IOReadHandle *ioh); #if 0 -- 2.25.1