The "ping" network command

Blitz3D Forums/Blitz3D Programming/The "ping" network command

_33(Posted 2008) [#1]
Anyone has a clue how this works?


Doiron(Posted 2008) [#2]
From the terminal/command prompt:
"ping domain" (i.e. ping www.google.com) or "ping ipaddress" (i.e. ping 209.85.135.99)

It isn't related to B3D programming though... or do you mean how can you replicate it?
In that case, the ping command uses the ICMP protocol, while in B3D to my knowledge you can only directly access TCP and UDP streams.
To do a TCP/UDP ping you should send a small packet to a certain address, check the time needed to respond and reduce the default waiting time for lost packets.


nawi(Posted 2008) [#3]
Don't use this for B3D multiplayer games, many computers have this disabled.


_33(Posted 2008) [#4]
Well, I wish to replicate the ping command in coding, and wondered how it can be done.


nawi(Posted 2008) [#5]
You just send a packet to the computer, then wait for a reply and see how many milliseconds it took. If you don't know how to do this then you need to study networking a little.


_33(Posted 2008) [#6]
I'm a total newbie at programming for network apps, and don't know hoa to send a "packet". What is the format of the packet? Do you mean like just sending a few bytes? I'd suppose that you'd want to ping multiple times in a row to get an average response time? (for 1 or 2 seconds)