|
@@ -1415,8 +1415,10 @@ namespace IMCS.CCS.Service.Impl
|
|
|
foreach (Device device in devices)
|
|
|
{
|
|
|
Ping pingSender = new Ping();
|
|
|
+
|
|
|
// 通过ping的方式测试网络是否联通
|
|
|
- PingReply reply = pingSender.Send(device.Ip);
|
|
|
+ PingReply reply = pingSender.Send(device.Ip, 1000);
|
|
|
+
|
|
|
if (reply.Status != IPStatus.Success)
|
|
|
{
|
|
|
Device oldDevice = await _deviceService.GetDeviceById(device.Id);
|
|
@@ -1429,7 +1431,7 @@ namespace IMCS.CCS.Service.Impl
|
|
|
}
|
|
|
|
|
|
Log.Instance.WriteLogAdd(device.Ip + ":" + device.ProtocolType + "连接失败,或已离线", LOG_TITLE_DEVICE);
|
|
|
- message = message+ "======设备连接失败,或已离线,ip:" + device.Ip + ",协议类型:" + device.ProtocolType;
|
|
|
+ message = message+ "======ip:" + device.Ip + "设备连接失败,或已离线,协议类型:" + device.ProtocolType;
|
|
|
continue;
|
|
|
}
|
|
|
else
|
|
@@ -1442,7 +1444,7 @@ namespace IMCS.CCS.Service.Impl
|
|
|
await _deviceService.UpdateAndCache(oldDevice);
|
|
|
}
|
|
|
Log.Instance.WriteLogAdd(device.Ip + ":"+ device.ProtocolType + "连接成功", LOG_TITLE_DEVICE);
|
|
|
- message = message + "======连接成功,ip:" + device.Ip + ",协议类型:" + device.ProtocolType;
|
|
|
+ message = message + "======ip:" + device.Ip + "连接成功,协议类型:" + device.ProtocolType;
|
|
|
continue;
|
|
|
}
|
|
|
Thread.Sleep(50);
|