.NET NetworkStream.EndWrite() 字节写入

标签 .net tcpclient networkstream

MSDN 文档明确指出:

After obtaining the NetworkStream, you can call the EndWrite method to successfully complete the send operation and return the number of bytes sent.

强调我的。

但是,它什么都不返回(void):

public override void EndWrite(
    IAsyncResult asyncResult
)

我是不是遗漏了什么,或者这是一个错字(EndRead() 确实返回读取的字节)。?

最佳答案

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

关于.NET NetworkStream.EndWrite() 字节写入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17537637/

相关文章:

c# - 是否可以在 DirectShow .Net 中使用 http url 作为源过滤器的源位置?

.net - 设计困境: who should handle disposable parameter?

c# - 获取控件的索引 : Controls. IndexOf 返回 -1

java - 在 TCP Client 中从服务器接收消息并在 TextView 中设置它

c# - 网络流写入被阻止

c# - 全双工 Tcp 数据交换 c#

c# - 如何将 ArrayList 转换为结构数组?

.net - 将 .net 4.0 插入 .net 2.0 测试

java - TCP 连接期间应用程序崩溃

c# - 通过 Internet 问题设置 TCP/IP 连接