8 Replies Latest reply on Apr 1, 2010 2:12 PM by jenryp

    AIR in a LAN

    jenryp Level 1

      HI!, I'm in the process of designing a new application, and what I want to know is:

       

      can Air support a  client/server architecture without any support from back-end stuff like  Cold Fusion or PHP?

       

      I want somebody to be able to run this app on their  desktop, and have multiple other users connect to them, and be able to  send data (asynchronously) back and forth.  I also want to save data  sent by clients to the hard drive on the server machine.

       

      Thanks!

      jenry

        • 1. Re: AIR in a LAN
          rkewlani

          Yes, that's very much doable. Checkout http://www.adobe.com/devnet/air/flex/articles/creating_socket_server.html

          Note that this functionality came into picture AIR 2 onwards.

          1 person found this helpful
          • 2. Re: AIR in a LAN
            jenryp Level 1

            Thanks rkewlani!!

            I don't have experience programming sockets, but I will try it.

            It would be great an example from Adobe showing how to use SQLite with a LAN.

            • 3. Re: AIR in a LAN
              rkewlani Level 2

              How do you exactly plan to use SQLite in LAN ? Can you explain it a bit. You might want to see how to use SQLDB in AIR http://www.adobe.com/devnet/air/flex/articles/air_sql_operations_02.html

              • 4. Re: AIR in a LAN
                jenryp Level 1

                well... I don't know!

                that's why I'm supplicating for help

                SQLite is a local DataBase, so I thought two options:

                1 - The client sent the query to the server and the server execute that query, maybe synchronous so we avoid multiple connections, and before executing maybe we can stop the client from the server side.

                2 - The client access directly to the .db file, and before tells the server so it can lock the DB access from the other clients until the first client ends.

                 

                I really don't know, I don't like any solution, and I'm very new with this, that because I think would be great an example from Adobe (or somebody else).

                • 5. Re: AIR in a LAN
                  rkewlani Level 2

                  You can easily integrate to a remote db through flex. I would recommend to use a db on a remote m/c i.e. the server in your case & all clients interact on a single database. That would be much simpler to manage & a cleaner approach. Let the server deal with the concurrency part. See this http://www.sephiroth.it/tutorials/flashPHP/as3flexdb/

                  • 6. Re: AIR in a LAN
                    jenryp Level 1

                    OK, but I think that solution has several problems:

                    1 - I need mySQL and PHP, so I need a server (maybe Apache) installed on the server machine, that's a lot of extra work for a simple DB I think...

                    2 - writing our query and login access inside our SWF is not secure, I was reading and many people noticed this too, they proposed some solutions (like hardcode the login inside the PHP not the SWF, and encrypt our querys inside AS3) but I think if I have mySQL PHP and a server ready I can just write my query in PHP.

                     

                    I need to work in a LAN, without Internet (at really there is an internet connection but I don't want my app be accesible by internet)

                    I need my app to be accesible from all the computers in the LAN, and at the same time.

                    Every user (with their own user and pass) can read and write on the DB, and print too...

                     

                    I can install Apache,mySQL and PHP on the "server" computer, I can write my application in C++ with FireBird too... but I was looking for the simplest solution. I'm very familar with AS3 right now (my C++ skills should be dusted before...), is not possible to make a simple DB app that works on a LAN with AIR and SQLite?

                     

                    Thanks!

                    enrique.

                     

                    PS: An extra problem is arising to me now too... AIR does AIR protect our code? or anyone can decompile our application as easy how our SWF files?

                    • 7. Re: AIR in a LAN
                      Joe ... Ward Level 4

                      It is possible to write a simple multi-user database with AIR 2, but is it simple? I would expect that following the herd by using established server and database software would be simpler in the end. You could use your AS3 skills for the client.

                       

                      AIR uses SWFs or HTML and JavaScript files. These are not encrypted in any way, so yes, they could be decompiled (like most or all binary code files).

                      • 8. Re: AIR in a LAN
                        jenryp Level 1

                        OK, so are you saying AIR is not the best option for a server application, just for client?

                        It's a pity, because installing a server like apache just for a simple database with a few users on a LAN looks like an exaggeration. I was trying to avoid that.

                        I think the Flash team should put a sample code or classes for a simple multi-user database with AIR 2.

                         

                        Anyway, I think I can't use AIR for this then