Messaging is nothing more than sending a fews string to one specific or all
clients from the server.
You'd want to create your own method/function in Red5 that will accept a few
parameters like:
public void incomingMessage( String msgText, String msgTarget ) {
// if the target is empty we'll send the message to all clients
connected to this room/scroop
// if the target has an ID we'll iterate through all connections and see
if one has that ID and then send the message to that single connection
}
On the flash/flex side you could create a custom function as well, that
you'd add to the client object of NetConnection , something like:
function incomingMessage(msgText:String, msgSenderID:String, msgSenderName)
{
// if the sender is a ID then it's a private incoming message,
especially for you, put the message in a private popup box or somethign
// if the sender is empty then it's a public message that should be
printed in the public/generic textarea
}
Best OOP practise is to create a new class and use that as the client object
e.g.
...
connection = new NetConnection();
connection.client = new CustomClientNetConnection();
...
class CustomClientNetConnection{
public function incomingMessage(msgText:String, msgSenderID:String,
msgSenderName):void {
// do stuff
}
}
...
You get the idea.
Walter
> Hi,
>
> I'm struggling with getting RED5 messaging services to work with a Flex
> client. In particular it isn't clear to me how to define and set a
> suitable
> channel for the "producer" and "consumer" entities in the client.
>
> Can messaging work over rtmp or is it limited to http channels?
> Also, how should I configure red5-web.xml to enable support for messaging?
> Are there any examples or tutorials I could consider similar to the
> excellent J. Bauch "Migration Guide" which helped me a lot in setting up
> Remote Object support?
>
> I'm sorry for the many questions but even after a lot of googling and
> searching through the mailing list it appears that messaging and data-push
> is one of the less debated issues in RED5.
>
> Thank you in advance for any light you will shed on this topic.
> Regards,
> Ettore
_______________________________________________
Red5 mailing list
Red5@...
http://osflash.org/mailman/listinfo/red5_osflash.org