Results 1 to 2 of 2

Thread: ShareObject to AMFDataMixedArray

  1. #1

    Question ShareObject to AMFDataMixedArray

    Help please!

    As SharedObject to Amfdataarray

    Since the number of users online over 2500 then the use of

    shareObjusersBox = SharedObject.getRemote (roomCont, nc.uri);
    shareObjusersBox.addEventListener (SyncEvent.SYNC, syncEventRoom);
    shareObjusersBox.connect (nc);
    Very expensive, the processor just bursting at the seams ...

    I just want to update the list of Customer service area asynchronously, getting every 5 seconds.


    	public void getUsersList(IClient client, RequestFunction function, AMFDataList params)
    	{
    		String soName = params.getString(PARAM1);
    		
    		AMFDataMixedArray clientList = new AMFDataMixedArray();
    		
    		ISharedObject users_so = getSO(soName, client.getAppInstance());	
    		clientList = (AMFDataMixedArray)users_so.getSlots();
    		
    		sendResult(client, params, clientList);
    		
    	}
    ERROR server comment - invoke(getUsersList): java.lang.ClassCastException: java.
    util.ArrayList cannot be cast to com.wowza.wms.amf.AMFDataArray: myPlugins.users
    List.getUsersList(usersList.java:30)
    java.lang.ClassCastException: java.util.ArrayList cannot be cast to com.wowza.wm
    s.amf.AMFDataArray
            at myPlugins.usersList.getUsersList(usersList.java:30)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at com.wowza.wms.module.ModuleFunction.invoke(Unknown Source)
            at com.wowza.wms.module.ModuleFunctions.invoke(Unknown Source)
            at com.wowza.wms.request.RequestProcessFunctions.processFunctions(Unknow
    n Source)
            at com.wowza.wms.client.ClientWorker.processNextReq(Unknown Source)
            at com.wowza.wms.request.RTMPRequestAdapter.service(Unknown Source)
            at com.wowza.wms.server.ServerHandler.a(Unknown Source)
            at com.wowza.wms.server.ServerHandler.a(Unknown Source)
            at com.wowza.wms.server.ServerHandler.messageReceived(Unknown Source)
            at com.wowza.wms.server.ServerHandlerThreadedSession.run(Unknown Source)
    
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source
    )
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
            at java.lang.Thread.run(Unknown Source)

  2. #2

    Default

    	public void getUsersList(IClient client, RequestFunction function, AMFDataList params)
    	{
    		String soName = params.getString(PARAM1);
    
    		AMFDataMixedArray clientList = new AMFDataMixedArray();		
    		ISharedObject users_so = getSO(soName, client.getAppInstance());		
    
    		List slotNames = users_so.getSlotNames();
    		Iterator iter = slotNames.iterator();
    		
    		while (iter.hasNext())
    		{
    			String slotName = (String)iter.next();
    			AMFDataObj userObj = (AMFDataObj)users_so.getSlot(slotName).getData();		
    			clientList.put(slotName, userObj);
    
    		}
    		
    		sendResult(client, params, clientList);
    		
    	}
    tnx all, close this post plz.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •