ping 的默认时间是多少?我使用下面的代码向 tcp 设备发送 ping。当 IPStatus 超时时发生在什么时候?
private static void ApplyPing(Topology.Runtime rt)
{
try
{
if (rt.TcpClient != null)
{
string ip = rt.Ip;
if (new Ping().Send(ip).Status != IPStatus.Success)
{
Service.WriteEventLog(string.Format("{0} ping error.", ip), EventLogEntryType.Warning);
rt.Disconnect();
}
}
}
catch (ArgumentNullException ex)
{
}
catch (Exception ex)
{
Service.WriteEventLog(ex, EventLogEntryType.Error);
}
}
谢谢您。