3 Replies Latest reply on Sep 10, 2009 7:34 AM by Xavi Colomer

    Sockets in AS3

    twitskull

      Hi,

       

      I have a question about sockets in Flex. I tried connection to socket (FTP) and everything works just fine. But now I would like to open connection to socket and listen it. This socket does not exist. Basicly what I would like to do in creating server (in Flex app loaded in firefox browser - KIOSK Mode) that will allow software on computer (a software i've written) to communicate with flex app loaded in browser.

       

      Is that even possible? How can I do this?

       

      I have established connection via MozRepl and it works. But number of layers between does not make this the best way. So that's why I would like to do such stuff directly in Flex app and let software to connect to it.

        • 1. Re: Sockets in AS3
          Xavi Colomer

          I don't know if I understood what you mean but the idea I get is that you are trying to put a Flex application on a server listening for an opened socket.

           

          If is this, you can't do that because Flex is always executed on the user's machine, you can upload the swf, but the application will run on your computer.

           

          To do that you should create a program in a backend language, like java or php, and listen on the frontend.

           

          P.S: If you are trying to create a messaging apllication you can look at this:

           

          JAVA: Blaze

          PHP: Google-> php socket pushing

          AJAX: APE Engine

           

          Hope it helps

          1 person found this helpful
          • 2. Re: Sockets in AS3
            twitskull Level 1

            I have linux installed on a pc. On this linux box I have this software:

             

            - firefox -> loaded Flex api to display some data,

            - python script collecting data from CPU usage etc.

             

            I would like to open socket port on my Flex app so python script could also connect to my Flex simple server and send data to it. In my case CPU usage (some string value). This data would be recieved in Flex app and displayed in it. In my previous post I stated a solution with a MozRepl firefox extension.

             

            I'm asking you if it is posible to writer some HTTP server in Adobe flex so python sould post something to localhost:7755 (defined in Flex).

             

            Does Adobe Flex have capatabilies to run own HTTP server?

             

            Thnx in advance

            • 3. Re: Sockets in AS3
              Xavi Colomer Level 1

              OK

               

              I think I finally understood. So you want to establish a connection to a Python socket in order to do data pushing to a flex application to show data, or maybe execute some programs remotelly.

               

              I don't know any way to build any Python Data Pushing server, but you may be interested using PyAMF and services.

               

              Does Adobe Flex have capatabilies to run own HTTP server?

              Flex is only a frontend language / technology, only Coldfusion, Java ( Tomcat ), PHP ( Apache ), ASP, etc... are able to run own HTTP Server

               

              I hope it helps

               

              X