Problem:
in my code, I set a timeout of a ping to 100ms
new Ping().Send(item._deviceIP, 100, new byte[1])
which pings correctly and replies correctly, but the IPStatus.TimeExceeded is "faulty" and reports a success after the RTT is > 100ms
What should happen:
when recieving a pingreply, if the IPStatus is a:
TimeExceeded (>100ms), _devicePing should have a color set to Red
Success(<=100ms), _devicePing should have a color set to green
any other, appropriate color is set.
What happens:
Any ping reply which is a reply report success even with a RTT >100ms
class device
{
public IPAddress _deviceIP;
public string _deviceMAC;
public string _deviceName;
public PingReply _devicePing ;
public Color _deviceStatus = Color.White;
public int _timeout_Count = 0;
public Color deviceStatus
{
get { return _deviceStatus; }
set { _deviceStatus = value; }
}
Main Program Code
List<device> _alive = new List<device>();
foreach (device item in _clients)
{
PingReply _client_reply = new Ping().Send(item._deviceIP, 100, new byte[1]);
item._devicePing = _client_reply; (item object accepts a PingReply)
IPStatus _client_status = _client_reply.Status;
switch (_client_status)
{
case IPStatus.TimeExceeded:
{
item.deviceStatus = Color.Red;
}
break;
//rest of code