This content has been marked as final. Show 7 replies
That's a GREET idea..let see if someone have some technical howTo.
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.
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 ?
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".
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.
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.
Thank you very much FlightGuy. Ineed to do this thing in PHP. I'm currently using AMFPHP. Is it possible ???