Ping and timeout
I need to ping something :) and get a response fast. If the "thing" doesn't answer the dafault timeout is too long. How can i make it faster?
I think it should be something like: ping -w0.05 10.0.0.1 but i cant get it to work. :newbie: |
You can just hit Ctrl+C if it's taking too long.
|
The -w switch just tells ping how long to wait before timing out and exiting - it doesn't actually speed up the time of the response. The response time mainly depends on the network latency and can't be set using ping.
|
Thanx guys, but it's not what i need.
I'm making a php script to ping a large wlan. That means every time the page loads it will ping about 200 routers. If six of those routers are offline i will have to wait 1 minute for the page to load with the default timeout. If one of the routers dont responde in 50ms I can assume there is something wrong, and it should time out. shell_exec("ping -c1 -t0.05 10.0.0.51"); works fine on windows, but on linux the timeout is just to long. Please help! :Pengy: |
My apologies - I see what you mean. I haven't been able to get -w working for values less than 1 second here.
Code:
$ time ping -w 1 -c1 165.86.4.1 Code:
$ time ping -t 1 -c1 165.86.4.1 |
Hi again and thanx for the reply.
Still cant get it to work. Maybe its the shell_exec command that works differently on linux and this post should in a php forum. Ill look around. Thanx again sic |
All times are GMT -5. The time now is 05:32 AM. |