views:

516

answers:

4

I'm bored cause my development server is down and I'm running the command prompt to ping the server indefinitely so that I'll see when they stop timing out and know that I can work again. In the meantime I wanted to make an Air app that will do this for me, so I can have it chirp or alarm or do something when it starts to be able to connect to the server.

So I need to start with having AIR do the ping, does anyone know how to do this? I can't find any help on it. I can't use the HTTPService because whatever it is that is broken (think it's the VPN), our dev web site is still up.

Thanks

A: 

The AIR SDK offers some classes (URLMonitor, SocketMonitor) to handle this:

http://livedocs.adobe.com/flex/3/html/help.html?content=network_connectivity_1.html

Jochen Hilgers
I looked at those and URL won't work since the URL works fine (our issue is VPN and I'm trying to ping the internal IP) and I wasn't sure about he socket monitor since I'm not lookign for a socket on the server, just wanting to ping and get back the latency. Would socket monitor be able to do that? How?
invertedSpear
+2  A: 

Otherwise you can use the NativeProcess class of the AIR 2.0 beta, and use the ping command of your operating system.

You can find informations on how to use it here.

Zed-K
I found this to be a bit over my head (at least for now) if anyone has an example of pinging through this method I would love to see it.
invertedSpear
A: 

Been having same issue lately> If anyone has been able to pul this off cos' the URlMonitor and the socketMonitor ain't doing the job.

oluwaseun
A: 

According to the docs, SocketMonitor, descending from ServiceMonitor will check basic availability, but not a true ping. If you want to truly "ping" the server, you would need to use a socket an implement the protocol, This link to the Wikipedia article might help.

mezmo