Jump to content

Ping () @error


Recommended Posts

Im looking to gather packet loss, i dont really want to use StdoutRead of @ComSpec

So im looking at the @error return of the standard Ping() but have a couple of questions.

if i Ping() some random addy like Ping("shshlsghwlgrhr") it dont return @error = 3 "Bad destination" why ?

also can i assume that a packet loss will set the @error = 4 ?

thx.

Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

Link to comment
Share on other sites

Hi JackDinn,

what result do you get when you ping "shshlsghwlgrhr"? Some ISP have the (bad/stupid) habbit that they try to catch a wrong spelled domain and redirect to a navigation page.

If you experience a packet loss, it would be an erro 1 or 2.

Edited by Hannes123
Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]
Link to comment
Share on other sites

hmm, all a bit odd

1 = Host is offline

2 = Host is unreachable

3 = Bad destination

4 = Other errors

so whats the difference between @error 1 and 2 ?

whats @error 3 and 4 for ?

in fact i cant see what any off these errors mean.

i shall just have to use what i was using before i updated my AI version , if i get an @error i count it as a packetloss. i have to assume the URL the user is pinging to is correct.

something like this :-

ping 3 times to URL ; make sure the url is correct and the server is responding

if any of the Pings return a reasonable (<1000ms) return then

For $x= 1 to 100

Pause for flood protection 30ish ms

Ping url

if @error=1 or @error=2 then $packetloss+=1

next

Packetloss = $packetloss & "%"

I would have done it with the console but its so slow at sending multiple pings Ping bbc.co.uk -n 100 , i cant figure out why or how to speed it up.

Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

Link to comment
Share on other sites

Hi JackDinn,

hmm, all a bit odd

1 = Host is offline

2 = Host is unreachable

3 = Bad destination

4 = Other errors

so whats the difference between @error 1 and 2 ?

whats @error 3 and 4 for ?

1 could be "offline" or package loss

2 could be sth like "your own network connection is down"

3 could be a wrong hostname or a malformatted IP address

4 ???

i shall just have to use what i was using before i updated my AI version , if i get an @error i count it as a packetloss. i have to assume the URL the user is pinging to is correct.

there's the _TCPIpToName function (maybe new in 3.3) you can use to verify if your DNS returns a valid information.

:unsure:

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]
Link to comment
Share on other sites

o right i shall have a look at _TCPIpToName,

I suppose what i really want to know is exactly which error a lost packet does return. Are you saying thee that a packet loss will always return error ==1 and will never return any of the others ?

wouldn't mind simulating packet loss (just to test with) but after looking into it it looks complicated and mainly described for linux anyhow.

Cheers.

Edited by JackDinn

Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

Link to comment
Share on other sites

Ah well I would need to test it too,

all I know is that you have sometimes different messages if you do a ping from the command line.

E.g. "Host not found", "Timeout" or "destination unreachable".

If you boot a windows PC/Server and do a "ping server -t" whilst it boots you'll receive "timeouts" and "unreachable" error messages. :unsure:

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]
Link to comment
Share on other sites

I think that this page might help tell you what the different returns might mean

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

hmm, so please correct me if im wrong but it looks like a packet lost can cause any of the errors 1, 2 or 3 if im only checking for packetloss in both directions (not checking for which way the packet was lost).

thx for the reading material , i must get and learn networking properly some time !!

Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...