Daniela Remogna escribió:
>> Hi,
>> I've a a problem with the syncronisation of a remote so.
>>
>> The aim of the so is to store the list of the users connected to my
>> application.
>>
>> When a client connect to my application, it receives the content of
>> the so, but
>> other client don't receive the new entry.
>>
>> I don't understand why :(
>>
>> This is my server-side code:
>>
>> Application.java
>>
>> public class Application extends ApplicationAdapter {
>>
>> public String user_name;
>> public boolean appConnect(IConnection conn, Object[] params){
>> user_name=(String)params[0];
>> Red5Debug.printDebug(user_name, "log.txt");
>>
>> Red5Debug.printDebug(Red5.getConnectionLocal().getClient().getId(),
>> "id.txt");
>> ISharedObject so =
>> getSharedObject(Red5.getConnectionLocal().getScope(),"usersSO",true);
I got it working without using SampleSharedObjectListener. This code
creates so if client hasn't done yet, and access it on appJoin method.
public class Application extends ApplicationAdapter {
protected String usuario = "";
protected ISharedObject soUsuarios = null;
public boolean appJoin(IClient client, IScope app){
if (!hasSharedObject(app, "usuarios")) createSharedObject(app,
"usuarios", false);
soUsuarios =getSharedObject(app, "usuarios", false);
soUsuarios.setAttribute(client.getId(), usuario);
...
public void appLeave(IClient client, IScope app){
soUsuarios.removeAttribute(client.getId());
}
All clients know who enters and who exits app (i'm not using rooms yet)
list[n].code will return "change" when another client has changed the so
list[n].code will return "delete" when an so attribute has been deleted
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org