Demo Tcp驱动连接状态判断

This commit is contained in:
iioter 2024-01-08 22:23:19 +08:00
parent 231534125a
commit 6c86b63d06

View File

@ -58,7 +58,7 @@ namespace Mock.TcpClient
get
{
//客户端对象不为空并且客户端已连接则返回true
return _client != null && _client.TcpClient.Connected;
return _client != null && _client.TcpClient != null && _client.TcpClient.Connected;
}
}