YangLei's

导航

 

2015年3月2日

摘要: C# TcpClient在连接成功后无法检测连接状态,即使对方关闭了网络连接。以下扩展可检测连接状态: static class TcpClientEx { public static bool IsOnline(this TcpClient c) { return !((c.Client.Poll(1000, SelectMode.SelectRead) && (c.Client.Avai... 阅读全文
posted @ 2015-03-02 17:35 大狼熙熙 阅读(961) 评论(0) 推荐(0) 编辑