如何设置C#TCPClient超时 [英] how to setup C# TCPClient timeout
本文介绍了如何设置C#TCPClient超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
Hello everyone,
我想知道我是否在C#中使用TCPClient类,如何设置超时值?超时我的意思是,当第一次连接到服务器时,以及< timeout>期间interval,如果没有收到服务器响应,GetStream方法将返回而不是永远等待返回。
I am wondering if I am using TCPClient class in C#, how to setup timeout value? Timeout I mean, when connects to server for the 1st time, and during <timeout> interval, if no server response is received, the GetStream method will return will return other than wait forever.
提前谢谢,
George
thanks in advance,
George
推荐答案
您可以尝试使用
You can try using
Code Snippet
这篇关于如何设置C#TCPClient超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文