7 Replies Latest reply on Feb 13, 2007 2:52 PM by TigerArt

    Instant Messaging

      I'm developing an instant messaging application with Flex 2.0 as a web-services project in my school. I have good experience in PHP. Please Help Me!
      What do I need to know ?
      What server side technology do I need ?
      Do I necessarily need Flex Data Services ?
      Can someone help me putting up an UML diagram for my application ?
      Thank You.
        • 1. Re: Instant Messaging
          Hugo_Core Level 1
          Hi TigerArt

          That's a GREET idea..let see if someone have some technical howTo.

          Someone ?..
          • 2. Re: Instant Messaging
            I think the best choice for your project wolud be Flex Data Services with its Messaging service, because as you said, you want "Instant Messages" which means that you need Real Time Messages. In this case you will use RTMP for communicating and you would have a persistent connection with server and clients.
            Another one could be, not exactly Real Time, maybe polling the server for changes or more messages for the client. This task could be done also by FDS via AMF, but you could also simulate it with PHP and your Flex App asking each "x" number of seconds the server.
            • 3. Re: Instant Messaging
              TigerArt Level 1
              Thank you Alberto Gonzalez
              But I think Flex Data Services is not free.
              Can I develop it with Flex Data Services Express Edition ?
              If I use Flex Data Services will I need a server-side language ?
              Will it work fine ?
              • 4. Re: Instant Messaging
                _Albertx_ Level 1
                Yeah, you can use Flex Data Services Express but you have a limit of concurrent connections. I think it's 10.

                FDS is a set of Java classes so you will need a Web Application Server Java Based, like WebSphere, JBoss, Fujitsu, Tomcat, ...

                The original language for developing with FDS is Java, but there are some other options for developing with .NET, or PHP, or Ruby, ... For example "WebOrb".
                • 5. Re: Instant Messaging
                  FlightGuy Level 1
                  If you want to do this without FDS, use the XMLSocket class. This will allow you to make a persistent socket connection to a server. I do this between a flex client and a Tomcat server, though you need to write your own socket listener and connection/session threads. Not too difficult. If you do this, you'll want to write a custom input and output stream class to deal with the 0-byte terminator at the end of each stanza. If you choose to do this, tell me and I'll post the java code for the stream wrappers. If you're using .NET by choice, you can implement equivalent stream wrappers.

                  A consequence of this (and also, I guess, of using FDS) is that you need to open additional port connections in your firewall - not just HTTP.

                  • 6. Re: Instant Messaging
                    FlightGuy Level 1
                    It's a pity, actually, that the XMLSocket class uses a 0-byte terminator, since it is almost exactly the same protocol as XMPP. XMPP also uses xml stanzas, though it has a preample when the connection is first established that starts an XML document, and closes it at the end of the session. It uses no terminator between stanzas, but the XML parser recognizes the completion of the stanza by reaching the end of the node.

                    Perhaps a future implementation :) of the XMLSocket class might include an XMPP option - this would allow you to write a flex client that can interact with Jabber or Google chat, both of which use XMPP.

                    • 7. Re: Instant Messaging
                      TigerArt Level 1
                      Thank you very much FlightGuy. Ineed to do this thing in PHP. I'm currently using AMFPHP. Is it possible ???