gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r20906 - in gnunet/src: include stream


From: gnunet
Subject: [GNUnet-SVN] r20906 - in gnunet/src: include stream
Date: Fri, 6 Apr 2012 09:36:40 +0200

Author: harsha
Date: 2012-04-06 09:36:40 +0200 (Fri, 06 Apr 2012)
New Revision: 20906

Modified:
   gnunet/src/include/gnunet_stream_lib.h
   gnunet/src/stream/stream_api.c
Log:
-added shutdown handle and cancel

Modified: gnunet/src/include/gnunet_stream_lib.h
===================================================================
--- gnunet/src/include/gnunet_stream_lib.h      2012-04-05 14:28:11 UTC (rev 
20905)
+++ gnunet/src/include/gnunet_stream_lib.h      2012-04-06 07:36:40 UTC (rev 
20906)
@@ -125,19 +125,36 @@
 
 
 /**
+ * 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
  */
 void

Modified: gnunet/src/stream/stream_api.c
===================================================================
--- gnunet/src/stream/stream_api.c      2012-04-05 14:28:11 UTC (rev 20905)
+++ gnunet/src/stream/stream_api.c      2012-04-06 07:36:40 UTC (rev 20906)
@@ -428,10 +428,28 @@
 
 
 /**
+ * Handle for Shutdown
+ */
+struct GNUNET_STREAM_ShutdownHandle
+{
+  /**
+   * The socket associated with this shutdown handle
+   */
+  struct GNUNET_STREAM_Socket *socket;
+
+  /**
+   * Which operation to shutdown? SHUT_RD, SHUT_WR or SHUT_RDWR
+   */
+  int operation;
+};
+
+
+/**
  * Default value in seconds for various timeouts
  */
 static unsigned int default_timeout = 10;
 
+
 /**
  * Callback function for sending queued message
  *
@@ -2356,11 +2374,24 @@
  *
  * @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)
 {
+  return NULL;
+}
+
+
+/**
+ * Cancels a pending shutdown
+ *
+ * @param the shutdown handle returned from GNUNET_STREAM_shutdown
+ */
+void
+GNUNET_STREAM_shutdown_cancel (struct GNUNET_STREAM_ShutdownHandle *handle)
+{
   return;
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]