From 67480d02e8729308defdc5256dd00dc3b887a5ea Mon Sep 17 00:00:00 2001 From: Sree Harsha Totakura Date: Fri, 6 Apr 2012 07:36:40 +0000 Subject: -added shutdown handle and cancel --- src/include/gnunet_stream_lib.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src/include/gnunet_stream_lib.h') diff --git a/src/include/gnunet_stream_lib.h b/src/include/gnunet_stream_lib.h index 5a2f9b2e4..a16d052d6 100644 --- a/src/include/gnunet_stream_lib.h +++ b/src/include/gnunet_stream_lib.h @@ -124,19 +124,36 @@ GNUNET_STREAM_open (const struct GNUNET_CONFIGURATION_Handle *cfg, ...); +/** + * Handle for shutdown + */ +struct GNUNET_STREAM_ShutdownHandle; + + /** * Shutdown the stream for reading or writing (man 2 shutdown). * * @param socket the stream socket * @param how SHUT_RD, SHUT_WR or SHUT_RDWR + * @return the shutdown handle */ -void +struct GNUNET_STREAM_ShutdownHandle * GNUNET_STREAM_shutdown (struct GNUNET_STREAM_Socket *socket, int how); /** - * Closes the stream + * Cancels a pending shutdown + * + * @param the shutdown handle returned from GNUNET_STREAM_shutdown + */ +void +GNUNET_STREAM_shutdown_cancel (struct GNUNET_STREAM_ShutdownHandle *handle); + + +/** + * Closes the stream and frees the associated state. The stream should be + * shutdown before closing. * * @param socket the stream socket */ -- cgit v1.2.3