Get connection counts to server, application, appInstance and stream

https://www.wowza.com/docs/how-to-get-connection-counts-for-server-applications-and-application-instances-sent-to-a-flash-application-modulegetconnectioncount

Hi

this code is almost what i’m looking for but not exactly and i cannot get what i need.

i made a function that list all instances for a specified application:

public void checkOnline(IClient client, RequestFunction function,
			AMFDataList params) {
		IApplication application = client.getApplication();
		List appInstanceNames = application.getAppInstanceNames();
		Iterator appiter = appInstanceNames.iterator();
		AMFDataArray amfDataArray = new AMFDataArray();
		while(appiter.hasNext())
		{
			String appInstanceName = (String)appiter.next();
			//AMFDataArray
			amfDataArray.add(appInstanceName);
		}
		sendResult(client, params, amfDataArray);
	}

i would like if possible in the same function to retrieve the client number in each instance. But as only the instances names are retrieved, i cannot use

int count = (int)applicationInstance.getConnectionCounter().getCurrent();

how could i retrieve the instance identifier (applicationInstance) in my first function ?

thanks !

Hi Richard and thx for your reply.

httpProvider seems interesting but:

  • i canno’t compile the example in wowza IDE (have “cannot be resolved as a type” error at the foloowing line: private HTTPCrossdomainHandler crossdomainHandler = new HTTPCrossdomainHandler():wink:

  • i believe i am 1 line away from what i need with the server side function, so in any case it would be interesting for me to have both versions available.

thanks for your help !

Gabriel

Okay i think i have it:

just added

IApplicationInstance app = application.getAppInstance(appInstanceName);
			int count = (int)app.getConnectionCounter().getCurrent();

in my terator loop, haven’t tryed yet but i guess will be working

many thanks !

Wouldn’t this be a better starting place:

http://community.wowza.com/t/-/60

Richard