OK, What I am trying is a very basic "Ping" but it seems to ignore the timeout value I set in the ping.send overload...
vb.net Code:
Imports System.Net Imports System.Net.NetworkInformation Dim ping As New Ping Dim intTimeout As Integer = 200 Dim reply as PingReply = ping.Send("192.168.12.200", intTimeout) Dim q As Integer = reply.RoundtripTime Console.WriteLine(q & " " & intTimeout) Select Case reply.Status Case IPStatus.TimedOut Console.WriteLine(reply.Status.ToString) Case IPStatus.Success Console.WriteLine("Success") Case Else Console.WriteLine(reply.Status.ToString) End Select
That should be that if it takes longer than 200ms it is classed as a "Time Out" and returns 0 for the ping time, however it replies as a success when the ping time is greater than the timeout value.
Note: the cases are there with the code snipped as they are not relevant because it always passes into the "success" category.
Any ideas? I have tried using Async pings too, but they produce the same result...
Cheers,
Stu




Reply With Quote
