移除DeviceManager.cs中错误的心跳机制实现

This commit is contained in:
zqm
2025-10-31 15:24:51 +08:00
parent eea1cabc01
commit 079c15fe09

View File

@@ -1222,21 +1222,6 @@ namespace JoyD.Windows.CS.Toprie
if (DateTime.Now - lastConnectionCheckTime > TimeSpan.FromSeconds(30))
{
Log("定期检查温度数据连接状态");
// 尝试发送一个简单的心跳消息到TCP连接
try
{
if (localStream != null && localStream.CanWrite)
{
byte[] heartbeat = Encoding.ASCII.GetBytes("heartbeat\r\n");
localStream.Write(heartbeat, 0, heartbeat.Length);
localStream.Flush();
Log("温度数据连接心跳发送成功");
}
}
catch (Exception ex)
{
Log($"温度数据连接心跳发送失败: {ex.Message},可能需要重新连接");
}
lastConnectionCheckTime = DateTime.Now;
}
}