diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2012-03-25 13:33:20 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2012-03-25 13:33:20 +0000 |
commit | bb613dd9d32c66e3eb6d87f583d2be137d4137e6 (patch) | |
tree | 29bec68af651382bf248c0331c7ddc2b017c5735 /src/include/gnunet_stream_lib.h | |
parent | d7a5c656d467597fcb6a7fb6daa84c3c5e7bae31 (diff) | |
download | gnunet-bb613dd9d32c66e3eb6d87f583d2be137d4137e6.tar.gz gnunet-bb613dd9d32c66e3eb6d87f583d2be137d4137e6.zip |
-added write io cancellation
Diffstat (limited to 'src/include/gnunet_stream_lib.h')
-rw-r--r-- | src/include/gnunet_stream_lib.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/include/gnunet_stream_lib.h b/src/include/gnunet_stream_lib.h index 78b11d1c5..5a2f9b2e4 100644 --- a/src/include/gnunet_stream_lib.h +++ b/src/include/gnunet_stream_lib.h | |||
@@ -217,13 +217,17 @@ struct GNUNET_STREAM_IOWriteHandle; | |||
217 | struct GNUNET_STREAM_IOReadHandle; | 217 | struct GNUNET_STREAM_IOReadHandle; |
218 | 218 | ||
219 | /** | 219 | /** |
220 | * Tries to write the given data to the stream | 220 | * Tries to write the given data to the stream. The maximum size of data that |
221 | * can be written as part of a write operation is (64 * (64000 - sizeof (struct | ||
222 | * GNUNET_STREAM_DataMessage))). If size is greater than this it is not an API | ||
223 | * violation, however only the said number of maximum bytes will be written. | ||
221 | * | 224 | * |
222 | * @param socket the socket representing a stream | 225 | * @param socket the socket representing a stream |
223 | * @param data the data buffer from where the data is written into the stream | 226 | * @param data the data buffer from where the data is written into the stream |
224 | * @param size the number of bytes to be written from the data buffer | 227 | * @param size the number of bytes to be written from the data buffer |
225 | * @param timeout the timeout period | 228 | * @param timeout the timeout period |
226 | * @param write_cont the function to call upon writing some bytes into the stream | 229 | * @param write_cont the function to call upon writing some bytes into the |
230 | * stream | ||
227 | * @param write_cont_cls the closure | 231 | * @param write_cont_cls the closure |
228 | * @return handle to cancel the operation; NULL if a previous write is pending | 232 | * @return handle to cancel the operation; NULL if a previous write is pending |
229 | */ | 233 | */ |
@@ -270,7 +274,19 @@ GNUNET_STREAM_read (struct GNUNET_STREAM_Socket *socket, | |||
270 | 274 | ||
271 | 275 | ||
272 | /** | 276 | /** |
273 | * Cancel pending write operation. | 277 | * Cancels pending write operation. Also cancels packet retransmissions which |
278 | * may have resulted otherwise. | ||
279 | * | ||
280 | * CAUTION: Normally a write operation is considered successful if the data | ||
281 | * given to it is sent and acknowledged by the receiver. As data is divided | ||
282 | * into packets, it is possible that not all packets are received by the | ||
283 | * receiver. Any missing packets are then retransmitted till the receiver | ||
284 | * acknowledges all packets or until a timeout . During this scenario if the | ||
285 | * write operation is cancelled all such retransmissions are also | ||
286 | * cancelled. This may leave the receiver's receive buffer incompletely filled | ||
287 | * as some missing packets are never retransmitted. So this operation should be | ||
288 | * used before shutting down transmission from our side or before closing the | ||
289 | * socket. | ||
274 | * | 290 | * |
275 | * @param ioh handle to operation to cancel | 291 | * @param ioh handle to operation to cancel |
276 | */ | 292 | */ |