C
Chad Z. Hower aka Kudzu
The docs are not clear on a few points, particularly one. And considering
that the excerpted Async examples on MSDN have a bad link to the master, and
tha the one complete example appears to have a small bug that it wont compile
(Havent tried it, but syntax in one spot looks wrong and does not match
others, nor compile when that one item is duplicated) Im left to guess.
BeginRead/Write accepts a length of bytes to read/write. It makes a call back
at a later time when this is "complete". You can then use EndRead to
determine how many bytes were read. EndWrite does not return a value.
a) Can the call back ever be made in which the number of bytes is less than
requested in BeginRead - yet it not be an error. That is its just calling
back to you to say "I did this much" and you have to call BeginRead again.
Similar to how non blocking sockets work in Winsock. Or, is it that if
EndRead ever returns less bytes than requested in BeginRead, it should be
considered an error.
b) Same question - but EndWrite. But since EndWrite does not return a size,
it should thus be assumed that writes are ALWAYS completed successfully when
the call back is made, unless EndWrite raises an exception.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
ELKNews - Get your free copy at http://www.atozedsoftware.com
that the excerpted Async examples on MSDN have a bad link to the master, and
tha the one complete example appears to have a small bug that it wont compile
(Havent tried it, but syntax in one spot looks wrong and does not match
others, nor compile when that one item is duplicated) Im left to guess.
BeginRead/Write accepts a length of bytes to read/write. It makes a call back
at a later time when this is "complete". You can then use EndRead to
determine how many bytes were read. EndWrite does not return a value.
a) Can the call back ever be made in which the number of bytes is less than
requested in BeginRead - yet it not be an error. That is its just calling
back to you to say "I did this much" and you have to call BeginRead again.
Similar to how non blocking sockets work in Winsock. Or, is it that if
EndRead ever returns less bytes than requested in BeginRead, it should be
considered an error.
b) Same question - but EndWrite. But since EndWrite does not return a size,
it should thus be assumed that writes are ALWAYS completed successfully when
the call back is made, unless EndWrite raises an exception.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
ELKNews - Get your free copy at http://www.atozedsoftware.com