3

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

4

1 回答 1

4

你没有错过任何东西,这是一个文档错误。可能是由复制/粘贴 EndRead 文章引起的。它在哪里非常重要。您已经知道写入了多少字节,所有字节。

于 2013-07-09T01:05:34.260 回答