I have an Adobe Air desktop app that was used for an event recently that thousands of people used simultaneously started getting failed network checks when using google.com
as a polling URL. Having each app checking every 3 seconds to that URL, about 10 minutes into the event every app started being redirected to a validation page on Google asking the user to prove they aren't a robot which obviously they couldn't see and therefore all users were told they had no internet. I am already using Akamai's Advanced Streaming plugin (which is based on OSMF [which uses NetStream]) for the video streaming. Is there a better way to check for a network connection (preferably just using the existing NetStream object).
Here is the existing code for the network monitor:
public function checkNetwork(url:String):void {
var urlRequest:URLRequest = new URLRequest(url);
urlRequest.method = "GET";
urlMonitor = new URLMonitor(urlRequest);
urlMonitor.addEventListener(StatusEvent.STATUS,onStatusChange);
urlMonitor.pollInterval = 3000;
urlMonitor.start();
}
private function onStatusChange(event:StatusEvent):void {
if(urlMonitor.available) {
isNetworkDown = false;
dispatchEvent(new Event("NetworkManager.NETWORK_UP"));
}
else {
isNetworkDown = true;
dispatchEvent(new Event("NetworkManager.NETWORK_DOWN"));
}
}