5 Replies Latest reply on Dec 6, 2008 8:51 AM by rrhyne

    Service Monitor crashing my app on computer Sleep

    rrhyne Level 1
      This happens reliably every time I put my laptop to sleep and on 3 different laptops, one pc running vista, 2 macs (mac book pro running 10.5 and powerbook running 10.4.x)

      I've pulled this from my Console:
      12/1/08 7:36:05 AM com.apple.launchd[89] ([0x0-0x12d12d].MyApp.AD2EA9E4B2AC983DA8BACF838450A1D27CCAA285.1[5428]) Exited abnormally: Bus error
      12/1/08 7:36:09 AM MyApp[6706] NSDocumentController Info.plist warning: The values of CFBundleTypeRole entries must be 'Editor', 'Viewer', 'None', or 'Shell'.

      servicemonitor was also implicated in crashing dreamweaver, but I don't have those logs any more.

      I have upgraded to 1.5 recently, previous to 1.5 my app got a bug after being put to sleep, but I could never track the source, and hadn't thought of looking in the console. (whoops.)

      I have replace the old servicemonitor.swf with the version in the 1.5 sdk, and my code matches up with the 1.5 docs, perfectly other than some variable name variance.

      Here is my code:

      var conn = true;
      var serve_monitor;
      function initConnectionManager() {
      trace("initializing connection manager");
      var request = new air.URLRequest(remoteUrl);
      serve_monitor = new air.URLMonitor( request );
      serve_monitor.addEventListener(air.StatusEvent.STATUS, manageConnectStatus);
      serve_monitor.start();
      }

      function manageConnectStatus(e) {
      if(serve_monitor.available == false){
      displayOfflineMessage();
      conn = false;
      }else if(serve_monitor.available == true){
      if(conn == false){
      conn = true;
      //trace("internet now available, reloding.");
      window.location = "root.html";
      }
      }
      }

      Comment out the code in initConnectionManager and the app runs completely fine after the computor put to sleep.

      Is anyone out there experiencing anything similar?

      Are there workarounds?

      My app relies on an internet connection, and I'm loathe to release without this being fixed.

      Thanks in advance for any help!