According to the FMS documentation (
http://livedocs.adobe.com/fms/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000607.html)
the onSync event is called when any client does an update.
My construction is maybe a bit weird:
user sends data via SharedObject by calling "newMessage" method:
/* AS3 */
_so = SharedObject.getRemote( _room , _uri+"/"+_room , false );
_so.addEventListener( NetStatusEvent.NET_STATUS , netStatusHandler );
_so.addEventListener( AsyncErrorEvent.ASYNC_ERROR , asyncErrorHandler );
_so.addEventListener( SyncEvent.SYNC , sharedObjectUpdate );
_so.client = this;
_so.connect ( connection );
_so.send ( "newMessage" , user , userid , msg );
public function sharedObjectUpdate(event:SyncEvent):void{
_data = _so.data.history;
}
Red5 listens to the event and logs some data and puts the new data in
correct format in the variable "history":
/* Red5 */
/* creation of SO */
createSharedObject( scope , roomname , false );
ISharedObject shared = getSharedObject( scope , roomname )
public void newMessage( String username , String userid , String message ) {
so.beginUpdate();
String history = (String) so.getAttribute("history");
history += "<span class='user'>"+username+"</span>: <span
class='text'>"+message+"</span>\n";
so.setAttribute("history", history);
so.endUpdate();
log.info(message);
}
If I run my app with only one user the onSync event is never triggered, if
there are 2 users the sender receives his message 2 messages later and the
receiver is 1 message behind.
What is wrong? Am I wrong?
On 8/15/07, Dominick Accattato <[EMAIL PROTECTED]> wrote:
>
> I believe SharedObject's are supposed to send only a event.info.code =
> success to the sender.
> Additionally if you change a sharedobject's data to what it already
> contains, no sync happens which is intended.
> I'll have to do some checks though.
>
> On 8/14/07, Martijn van Beek <[EMAIL PROTECTED]> wrote:
> >
> > Somehow R5 is behaving strangely with SharedObject in my application.
> > According to my knowledge a sharedObject broadcasts and sends an update to
> > every client disregarding the fact who is the sender (My FMS application I
> > made last year behaves that way).
> >
> > R5 doesn't do this, is this on purpose? I run 0.6.2 on Ubuntu with Java
> > 1.6.
> >
> > _______________________________________________
> > Red5 mailing list
> > [email protected]
> > http://osflash.org/mailman/listinfo/red5_osflash.org
> >
> >
>
>
> --
> Dominick Accattato, CTO
> Infrared5 Inc.
> www.newviewnetworks.com
> _______________________________________________
> Red5 mailing list
> [email protected]
> http://osflash.org/mailman/listinfo/red5_osflash.org
>
>
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org