对于TCPClient,我是否需要处理网络缓冲区满问题的情况?谢谢 [英] For TCPClient, do i need to handle the case that the network buffer full problem?Thanks

查看:376
本文介绍了对于TCPClient,我是否需要处理网络缓冲区满问题的情况?谢谢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用TCPClient。

For using TCPClient.

我可以使用NetworkStream.WriteAsync方法将字节数组写入网络缓冲区,但如果网络缓冲区已满,如何处理?因为它没有返回成功写入newtork缓冲区的字节数?

I can use NetworkStream.WriteAsync method to write byte array to the network buffer, but how to handle if the network buffer is full?? Because it has no return of the number of byte successfully written to the newtork buffer??

public bool Send(byte [] data)

public bool Send(byte[] data)

{

networkStream.WriteAsync(data,0,data.Length)??

networkStream.WriteAsync(data, 0, data.Length)??

}

推荐答案

HK HK用户,

Hi HK User,

 欢迎来到MSDN论坛支持。

  Welcome to MSDN Forum Support.

  您更有可能以
http://social.msdn.microsoft.com/Forums/pl-pl/ncl/threads 在哪里可以联系网络类库(System.Net)专家,所以我想
喜欢将你重定向到适当的论坛以获得更好的b
回复。


这篇关于对于TCPClient,我是否需要处理网络缓冲区满问题的情况?谢谢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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