...);
+/**
+ * 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
*/
};
+/**
+ * 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
*
*
* @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;
}