[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r20907 - in gnunet/src: include stream
From: |
gnunet |
Subject: |
[GNUnet-SVN] r20907 - in gnunet/src: include stream |
Date: |
Fri, 6 Apr 2012 09:46:24 +0200 |
Author: harsha
Date: 2012-04-06 09:46:24 +0200 (Fri, 06 Apr 2012)
New Revision: 20907
Modified:
gnunet/src/include/gnunet_stream_lib.h
gnunet/src/stream/stream_api.c
Log:
-shutdown completion callback
Modified: gnunet/src/include/gnunet_stream_lib.h
===================================================================
--- gnunet/src/include/gnunet_stream_lib.h 2012-04-06 07:36:40 UTC (rev
20906)
+++ gnunet/src/include/gnunet_stream_lib.h 2012-04-06 07:46:24 UTC (rev
20907)
@@ -131,15 +131,31 @@
/**
+ * Completion callback for shutdown
+ *
+ * @param cls the closure from GNUNET_STREAM_shutdown call
+ * @param operation the operation that was shutdown (SHUT_RD, SHUT_WR,
+ * SHUT_RDWR)
+ */
+typedef void (*GNUNET_STREAM_ShutdownCompletion) (void *cls,
+ int operation);
+
+
+/**
* Shutdown the stream for reading or writing (man 2 shutdown).
*
* @param socket the stream socket
- * @param how SHUT_RD, SHUT_WR or SHUT_RDWR
+ * @param opertion SHUT_RD, SHUT_WR or SHUT_RDWR
+ * @param completion_cb the callback that will be called upon successful
+ * shutdown of given operation
+ * @param completion_cls the closure for the completion callback
* @return the shutdown handle
*/
struct GNUNET_STREAM_ShutdownHandle *
GNUNET_STREAM_shutdown (struct GNUNET_STREAM_Socket *socket,
- int how);
+ int operation,
+ GNUNET_STREAM_ShutdownCompletion completion_cb,
+ void *completion_cls);
/**
Modified: gnunet/src/stream/stream_api.c
===================================================================
--- gnunet/src/stream/stream_api.c 2012-04-06 07:36:40 UTC (rev 20906)
+++ gnunet/src/stream/stream_api.c 2012-04-06 07:46:24 UTC (rev 20907)
@@ -2370,15 +2370,20 @@
/**
- * Shutdown the stream for reading or writing (man 2 shutdown).
+ * Shutdown the stream for reading or writing (similar to man 2 shutdown).
*
* @param socket the stream socket
- * @param how SHUT_RD, SHUT_WR or SHUT_RDWR
+ * @param opertion SHUT_RD, SHUT_WR or SHUT_RDWR
+ * @param completion_cb the callback that will be called upon successful
+ * shutdown of given operation
+ * @param completion_cls the closure for the completion callback
* @return the shutdown handle
*/
struct GNUNET_STREAM_ShutdownHandle *
GNUNET_STREAM_shutdown (struct GNUNET_STREAM_Socket *socket,
- int how)
+ int operation,
+ GNUNET_STREAM_ShutdownCompletion completion_cb,
+ void *completion_cls)
{
return NULL;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r20907 - in gnunet/src: include stream,
gnunet <=