As the title says, I've got a air.net.URLMonitor
that sometimes doesn't dispatch a StatusEvent
in case the specified site cannot be reached.
Let me show you my code:
_serverURL = "http://192.168.0.20:8080/"
_monitor = new URLMonitor(new URLRequest(_serverURL));
_monitor.pollInterval = 1000;
_monitor.addEventListener(StatusEvent.STATUS, serverStatusResult);
_monitor.start();
And here is my problem, when my iPad (this is a mobile AIR application btw) is in the correct network, so the one where the specified server is available, the StatusEvent is correctly dispatched. When I'm not in that network, nothing happens and I really don't know why. Shouldn't it dispatch the event anyway?
This isn't an isolated issue, when our production environment server gets updated and isn't online, the same issue appears, however when the iPad is in offline mode and cannot reach the server because of that, the StatusEvent
fires.
Is there a reasonable explanation for that, and if so, how can I correctly implement this?
Should I use a standard HTTPService
instead and simply listen for ResultEvent and FaultEvent?
As usual, any help would be greatly appreciated! Cheers.