Hi,
I'm still having problems with server side access to shared
objects
My code runs fine in 0.5, but not in 0.6rc1 or the trunk.
my code is...
______________________________________________________________________
public class Application extends ApplicationAdapter
{
private static final Log log =
LogFactory.getLog(Application.class);
@Override
public boolean appStart(IScope scope)
{
// initiating the handler here
boolean b;
ISharedObject userlistSO=null;
b=createSharedObject(scope, "mySO", true);
log.info("\n\n\nSOSample2 started ");
if (!b)
{
log.info("\n\n\ncreateSharedObject FAILED ");
}
userlistSO = getSharedObject(scope,"mySO");// get a
reference to the object we just created
if (userlistSO !=null)
{
// userlistSO.lock();
userlistSO.removeAttributes();
userlistSO.setAttribute("random",1);
//
userlistSO.setAttribute("log.isInfoEnabled()",log.isInfoEnabled());
//
userlistSO.setAttribute("log.isDebugEnabled()",log.isDebugEnabled());
}
else
{
log.info("\n\n\nCan't setup SO\n\n\n");
}
return super.appStart(scope);
}
public void TriggerObject()
{
double val;
ISharedObject iso= getSharedObject(this.scope,"mySO");
if (iso!=null)
{
log.debug("\n\nTriggerObject set attribute\n");
val=Math.random()*1000;
iso.beginUpdate();
iso.setAttribute("random", val);// Put a random
number in the SO
iso.endUpdate();
}
else
{
log.debug("\nCANT GET SHARED OBJECT\n\n");
}
}
)
________________________________________________________________________
TriggerObject is called from the client app, to test server
side changes to the SO.
The call TriggerObject only works once, and then after a
timeout period the client reports the server has
disconnected - which leads me to think that the call to
setAttribute has hung.
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org