diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2012-04-06 07:36:40 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2012-04-06 07:36:40 +0000 |
commit | 67480d02e8729308defdc5256dd00dc3b887a5ea (patch) | |
tree | e0383f0668bb234fa67ea6d388ae1476354355a1 /src/include/gnunet_stream_lib.h | |
parent | 205cf0218a8097222bd2d8ea21a1a94c32b2bdbd (diff) | |
download | gnunet-67480d02e8729308defdc5256dd00dc3b887a5ea.tar.gz gnunet-67480d02e8729308defdc5256dd00dc3b887a5ea.zip |
-added shutdown handle and cancel
Diffstat (limited to 'src/include/gnunet_stream_lib.h')
-rw-r--r-- | src/include/gnunet_stream_lib.h | 21 |
1 files changed, 19 insertions, 2 deletions
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 | |||
@@ -125,18 +125,35 @@ GNUNET_STREAM_open (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
125 | 125 | ||
126 | 126 | ||
127 | /** | 127 | /** |
128 | * Handle for shutdown | ||
129 | */ | ||
130 | struct GNUNET_STREAM_ShutdownHandle; | ||
131 | |||
132 | |||
133 | /** | ||
128 | * Shutdown the stream for reading or writing (man 2 shutdown). | 134 | * Shutdown the stream for reading or writing (man 2 shutdown). |
129 | * | 135 | * |
130 | * @param socket the stream socket | 136 | * @param socket the stream socket |
131 | * @param how SHUT_RD, SHUT_WR or SHUT_RDWR | 137 | * @param how SHUT_RD, SHUT_WR or SHUT_RDWR |
138 | * @return the shutdown handle | ||
132 | */ | 139 | */ |
133 | void | 140 | struct GNUNET_STREAM_ShutdownHandle * |
134 | GNUNET_STREAM_shutdown (struct GNUNET_STREAM_Socket *socket, | 141 | GNUNET_STREAM_shutdown (struct GNUNET_STREAM_Socket *socket, |
135 | int how); | 142 | int how); |
136 | 143 | ||
137 | 144 | ||
138 | /** | 145 | /** |
139 | * Closes the stream | 146 | * Cancels a pending shutdown |
147 | * | ||
148 | * @param the shutdown handle returned from GNUNET_STREAM_shutdown | ||
149 | */ | ||
150 | void | ||
151 | GNUNET_STREAM_shutdown_cancel (struct GNUNET_STREAM_ShutdownHandle *handle); | ||
152 | |||
153 | |||
154 | /** | ||
155 | * Closes the stream and frees the associated state. The stream should be | ||
156 | * shutdown before closing. | ||
140 | * | 157 | * |
141 | * @param socket the stream socket | 158 | * @param socket the stream socket |
142 | */ | 159 | */ |