4 Replies Latest reply on Mar 10, 2008 3:48 PM by Newsgroup_User

    Checking connection status

    pachash
      Hi!

      Is it possible to get the current status of the connection(e.g socket established, disconnected, etc)?
      I need this stuff in order to check if connection was dropped by the server.

      Thanks in advance.
        • 1. Re: Checking connection status
          Level 7
          You'll have to examine the messages the muXtra sends to your callback
          handler.

          First message sent by the xtra:
          subject: "ConnectToNetServer"
          errorcode: 0 connected, non zero failure.

          Disconnection message:
          subject: "ConnectionProblem"
          errorcode: <>0


          "pachash" <webforumsuser@macromedia.com> wrote in message
          news:fr00am$b1n$1@forums.macromedia.com...
          > Hi!
          >
          > Is it possible to get the current status of the connection(e.g socket
          > established, disconnected, etc)?
          > I need this stuff in order to check if connection was dropped by the
          > server.
          >
          > Thanks in advance.
          >





          • 2. Re: Checking connection status
            pachash Level 1
            quote:

            Originally posted by: Newsgroup User
            You'll have to examine the messages the muXtra sends to your callback
            handler.

            First message sent by the xtra:
            subject: "ConnectToNetServer"
            errorcode: 0 connected, non zero failure.

            Disconnection message:
            subject: "ConnectionProblem"
            errorcode: <>0


            This looks like an answer, thanks! Could you please show the JavaScript equivalent of registering the handler for these messages?

            • 3. Re: Checking connection status
              pachash Level 1
              quote:


              This looks like an answer, thanks! Could you please show the JavaScript equivalent of registering the handler for these messages?



              Sorry, I'm replying to myself but this seems to be working just fine:

              var networkLayer = new xtra("Multiuser");
              networkLayer.setNetMessageHandler(symbol("netMessageHandler"));

              • 4. Re: Checking connection status
                Level 7
                > Sorry, I'm replying to myself but this seems to be working just fine:
                By all means... :-)
                Since you are using javascript, and if you try to retrieve the errorstring
                of the errorcode passed to your callback handlers, you should search for a
                thread relative to this issue, that had been posted here a couple of months
                ago - "multiuser xtra javascript coding", Jan. 10, 08.



                "pachash" <webforumsuser@macromedia.com> wrote in message
                news:fr49in$4cr$1@forums.macromedia.com...
                >
                quote:


                > This looks like an answer, thanks! Could you please show the JavaScript
                > equivalent of registering the handler for these messages?
                >

                >
                > Sorry, I'm replying to myself but this seems to be working just fine:
                >
                > var networkLayer = new xtra("Multiuser");
                > networkLayer.setNetMessageHandler(symbol("netMessageHandler"));
                >
                >
                >