代码如下:
csharp
Socket s = new Socket(..);
if (s.Poll(-1, SelectMode.SelectRead))
{
int nRead = s.Receive();
if (nRead == 0)
{
//socket连接已断开
}
}