The MSDN documentation clearly states that:
After obtaining the NetworkStream, you can call the EndWrite method to successfully complete the send operation and return the number of bytes sent.
Emphasis mine.
However, it returns nothing (void):
public override void EndWrite(
IAsyncResult asyncResult
)
Am I missing something, or is this a typo (EndRead() does return bytes read).?
You are not missing anything, it is a doc bug. Probably induced by copy/pasting the EndRead article. Where it very much does matter. You already know how many bytes were written, all of them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With