您可以发送文件较大的SendBufferSize throuh一个TcpClient的? [英] Can you send a file larger that the SendBufferSize throuh a TcpClient?

查看:236
本文介绍了您可以发送文件较大的SendBufferSize throuh一个TcpClient的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试用TCP连接在.NET中,我想送一些数据比对的TcpClient对象的SendBufferSize proporty较大。是否有可能通过简单地写网络流或发送数据,我需要把它切PICES,并把这些和在另一端重新创建它?

I am experimenting with the Tcp connections in .NET and I would like to send some data that is larger than the SendBufferSize proporty of the TcpClient object. Is it possible to send the data by simply writing to the network stream or do I need to cut it in pices and send those and at the other end create it again?

推荐答案

从的 MSDN

如果网络缓冲区比数据的您提供的Write方法的金额较小,一些网络发送操作将被执行的每一个打电话给你做出Write方法。

If the network buffer is smaller than the amount of data you provide the Write method, several network send operations will be performed for every call you make to the Write method.

您只需要调用一次编写,该TcpClient的将处理拆分为多个网络运营。

You only need to call Write once, the TcpClient will handle splitting it into multiple network operations.

这篇关于您可以发送文件较大的SendBufferSize throuh一个TcpClient的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆