Question

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).?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top