Hi,

 

I have tested sending messages via sharedObject on FMS and Red5.

 

Server script on FMS:

 

application.>

      trace("TestApp");

      //

      application.flashSO = SharedObject.get("flashSO", false);

}

application.>

      application.acceptConnection(client);

      trace("onConnect");

      client.clientMessage = function(msg) {

            trace("clientMessage: " + msg);

            application.flashSO.send("serverMessage", "test");

      }

}

 

Server script on RED5 was:

 

public boolean appStart(IScope scope) {

            soEvL = new soEventListener();

            createSharedObject(scope,"flashSO", false);

           

            so = getSharedObject(scope,"flashSO");

            so.addSharedObjectListener(soEvL);

 

            list = new ArrayList<String>();

            list.add("test");

            return true;

}

public void clientMessage (String param){

            System.out.println("clientMessage: "+param);

            so.sendMessage("serverMessage", list)

}

 

Flash client:

 

so = SharedObject.getRemote("flashSO",nc.uri,false);

 

so.serverMessage = function(msg){

      writeln("serverMessage: "+msg);

}

 

btnSendClienMessage.>

      nc.call("clientMessage",null,"someMessage“);

}

 

so.connect(nc);

 

 

Everything works with one connected client. (FMS, Red5)

But when I connect 2 clients, so they call clientMessage. The messaging works on FMS, but on Red5, the message is delivered to only 1 client – the sender.

And that’s the problem.

 

Please tell me, what I am doing wrong – because it seams, that on Red5, sharedObjects are somehow connected to only one client – not to everyone who is observing him (in the same scope of course – when I write clients in the scope, I have them all there).

 

Actually I don’t want to implement my observer classes – using Red5 SharedObjects it could be much better.

 

Thanks

 

Tom Krcha

_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org

Reply via email to