3 Replies Latest reply on Jul 21, 2007 1:48 AM by farhanakhan

    how to get the ping of webstie in director mx

    farhanakhan Level 1
      Hi Guys.....
      Today my task in director to detect the net connection.........
      I m uploading some asp file and database at the particular website........

      i m going to make the registration system ....user must be register from the internet...
      so when user run my application then first it will check the internet connection..(some people say to me u hve to get the ping of the particular website)...
      so tell me how i will detect the internet connection..if active or not..
      if not then user must have the msgbox..plz connect ur net

      i don't want to detect network connection i want to detect the net connection...

      plz reply me fast how to detect the internet connection from the director mx....
        • 1. Re: how to get the ping of webstie in director mx
          Level 7
          I don't know how to do this in ASP, but I suspect it is pretty simple.
          In PHP, you would have a simple script like this:

          echo "connect";

          name it test.php.

          In Director, you can see call that page and see if you get the correct
          response, which will be the word "connect".

          The command to do that is getNetText()

          put getNetText(" http://servername.test.php")
          -- 1

          In this case the number 1 is the netID. You can use it in the other
          netLingo commands to see what is happening. Every time you cann
          getNetText() you will get a unique netID.

          put netTextResult(1)
          -- "connect"

          That means it is online. It is important to note that the netLingo
          commands are asynchronous, so you can not just put in a linear bunch of
          commands to get the text and verify it. You need to have a frame loop
          which will check if netDone(netID) is comeplete, and you should also
          check netError(netID). Check out the docs for those commands. There
          are samples that show how to make it work.
          • 2. how to get the ping of webstie in director mx
            Applied CD Level 1
            I’ve used Valentin Schmidt’s Shell Xtra ( http://staff.dasdeck.de/valentin/xtras/shell/) to execute pings from Director to keep a VPN connection alive. I think ping is used as a specific example in his “read me” document. The xtra can execute either synchronously or asynchronously. Waiting for a synchronous response is much easier from a programming standpoint but it’s a fairly bad approach for your users, working out the details for processing a net operation asynchronously will provide a much better user experience and as Mike said, all of the other net lingo operations are asynchronous anyway.

            That having been said, I’m not sure ping is really what you need. Any number of things can go wrong when communicating with a script on a remote server and you have to include significant error handling for most of them. A ping will tell you that the connection is alive and the server is responding to pings but that’s all. I would just request the registration page from the server and check netError() if the server fails to respond. (you’re going to need that error handler even if the server is responding to pings).

            PS: I stumbled across the following article while looking for something else but I think it might be relevant here. It describes another method for using shell xtra to determine if an internet connection is live. Frankly, I’m still not convinced all this extra work is necessary, you’re still going to have to check netError() if something goes wrong so you may as well use it from the very start, however, if you really must know if the connection is live before attempting communication here’s another approach:

            • 3. Re: how to get the ping of webstie in director mx
              farhanakhan Level 1
              guys thx a lot
              now my task is done ..

              code is -----

              global UURL

              on exitFrame me



              global UURL,netID,infolist

              on exitFrame me

              put infolist

              if infolist[1] = "connect" then

              netID = postNetText(UURL,infolist)


              netID = postNetText(UURL,infolist)

              end if


              global netID,vRS

              on exitFrame me

              if netDone(netID) then

              put "netDone(netID)=====" & netDone(netID)

              vRS = netTextResult(netID)


              go to the frame

              end if


              global vRS,Act_C
              on exitFrame me

              Act_C = vRS
              if vRS = "" then
              member("msgbox").text = "no internet connection”
              if vRS = "connect" then
              go to frame 25
              go to frame 113
              end if
              end if


              thx a lot