0 Replies Latest reply: Jul 27, 2009 5:43 AM by tSpark RSS

    Socket Connectivity at Startup

    tSpark

      I'm having trouble with the socket connector in my AIR 1.5 HTML/JavaScript implementation.  It seems that the application never detects as being online at startup.

       

              socketMonitor = new air.SocketMonitor('www.mydomain.com', 80);
              socketMonitor.start();

       

      Then, when the document is ready (jQuery $(document).ready), I run the following code.

       

         if (socketMonitor.available) {
              myfunction();
          }

       

      At launch, my function never triggers.  If I put that same code in a separate function and run it on a click event after the application loads, then it triggers just fine and finds socketMonitor.available to be true.

       

      It seems that it is taking a while for the socket monitor to recognize that it is online.  Why would that be?  Any suggestions for how to know AT STARTUP if the application is online or not?