aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2012-04-06 07:46:24 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2012-04-06 07:46:24 +0000
commitde986871fad51b69ccfc30c97a132e8cf45d94a7 (patch)
treea63a1c8a8e17bdc34b07109b3a22eafa9f989155
parent67480d02e8729308defdc5256dd00dc3b887a5ea (diff)
downloadgnunet-de986871fad51b69ccfc30c97a132e8cf45d94a7.tar.gz
gnunet-de986871fad51b69ccfc30c97a132e8cf45d94a7.zip
-shutdown completion callback
-rw-r--r--src/include/gnunet_stream_lib.h20
-rw-r--r--src/stream/stream_api.c11
2 files changed, 26 insertions, 5 deletions
diff --git a/src/include/gnunet_stream_lib.h b/src/include/gnunet_stream_lib.h
index a16d052d6..4a574dfe4 100644
--- a/src/include/gnunet_stream_lib.h
+++ b/src/include/gnunet_stream_lib.h
@@ -131,15 +131,31 @@ struct GNUNET_STREAM_ShutdownHandle;
131 131
132 132
133/** 133/**
134 * Completion callback for shutdown
135 *
136 * @param cls the closure from GNUNET_STREAM_shutdown call
137 * @param operation the operation that was shutdown (SHUT_RD, SHUT_WR,
138 * SHUT_RDWR)
139 */
140typedef void (*GNUNET_STREAM_ShutdownCompletion) (void *cls,
141 int operation);
142
143
144/**
134 * Shutdown the stream for reading or writing (man 2 shutdown). 145 * Shutdown the stream for reading or writing (man 2 shutdown).
135 * 146 *
136 * @param socket the stream socket 147 * @param socket the stream socket
137 * @param how SHUT_RD, SHUT_WR or SHUT_RDWR 148 * @param opertion SHUT_RD, SHUT_WR or SHUT_RDWR
149 * @param completion_cb the callback that will be called upon successful
150 * shutdown of given operation
151 * @param completion_cls the closure for the completion callback
138 * @return the shutdown handle 152 * @return the shutdown handle
139 */ 153 */
140struct GNUNET_STREAM_ShutdownHandle * 154struct GNUNET_STREAM_ShutdownHandle *
141GNUNET_STREAM_shutdown (struct GNUNET_STREAM_Socket *socket, 155GNUNET_STREAM_shutdown (struct GNUNET_STREAM_Socket *socket,
142 int how); 156 int operation,
157 GNUNET_STREAM_ShutdownCompletion completion_cb,
158 void *completion_cls);
143 159
144 160
145/** 161/**
diff --git a/src/stream/stream_api.c b/src/stream/stream_api.c
index 2180f919a..93d9c9fe2 100644
--- a/src/stream/stream_api.c
+++ b/src/stream/stream_api.c
@@ -2370,15 +2370,20 @@ GNUNET_STREAM_open (const struct GNUNET_CONFIGURATION_Handle *cfg,
2370 2370
2371 2371
2372/** 2372/**
2373 * Shutdown the stream for reading or writing (man 2 shutdown). 2373 * Shutdown the stream for reading or writing (similar to man 2 shutdown).
2374 * 2374 *
2375 * @param socket the stream socket 2375 * @param socket the stream socket
2376 * @param how SHUT_RD, SHUT_WR or SHUT_RDWR 2376 * @param opertion SHUT_RD, SHUT_WR or SHUT_RDWR
2377 * @param completion_cb the callback that will be called upon successful
2378 * shutdown of given operation
2379 * @param completion_cls the closure for the completion callback
2377 * @return the shutdown handle 2380 * @return the shutdown handle
2378 */ 2381 */
2379struct GNUNET_STREAM_ShutdownHandle * 2382struct GNUNET_STREAM_ShutdownHandle *
2380GNUNET_STREAM_shutdown (struct GNUNET_STREAM_Socket *socket, 2383GNUNET_STREAM_shutdown (struct GNUNET_STREAM_Socket *socket,
2381 int how) 2384 int operation,
2385 GNUNET_STREAM_ShutdownCompletion completion_cb,
2386 void *completion_cls)
2382{ 2387{
2383 return NULL; 2388 return NULL;
2384} 2389}