# Get connection counts to server, application, appInstance and stream

**URL:** <https://community.wowza.com/t/get-connection-counts-to-server-application-appinstance-and-stream/43>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [March 11, 2008, 7:04am UTC](https://community.wowza.com/t/get-connection-counts-to-server-application-appinstance-and-stream/43 "2008-03-11T07:04:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/system/32/447_2.png) [@system](https://community.wowza.com/u/system)\
**Post date:** [March 11, 2008, 7:04am UTC](https://community.wowza.com/t/get-connection-counts-to-server-application-appinstance-and-stream/43/1 "2008-03-11T07:04:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gabriel\_fg](https://avatars.discourse-cdn.com/v4/letter/g/a183cd/32.png) [@gabriel\_fg](https://community.wowza.com/u/gabriel_fg)\
**Post date:** [July 27, 2010, 10:24pm UTC](https://community.wowza.com/t/get-connection-counts-to-server-application-appinstance-and-stream/43/2 "2010-07-27T22:24:01Z")

</div>

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:

```auto
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

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

```

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

thanks !

---

<div class="post-metadata">

**Author:** ![gabriel\_fg](https://avatars.discourse-cdn.com/v4/letter/g/a183cd/32.png) [@gabriel\_fg](https://community.wowza.com/u/gabriel_fg)\
**Post date:** [July 28, 2010, 11:17am UTC](https://community.wowza.com/t/get-connection-counts-to-server-application-appinstance-and-stream/43/3 "2010-07-28T11:17:56Z")

</div>

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()😉

- 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

---

<div class="post-metadata">

**Author:** ![gabriel\_fg](https://avatars.discourse-cdn.com/v4/letter/g/a183cd/32.png) [@gabriel\_fg](https://community.wowza.com/u/gabriel_fg)\
**Post date:** [July 28, 2010, 11:43am UTC](https://community.wowza.com/t/get-connection-counts-to-server-application-appinstance-and-stream/43/4 "2010-07-28T11:43:42Z")

</div>

Okay i think i have it:

just added

```auto
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 !

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [July 27, 2010, 10:36pm UTC](https://community.wowza.com/t/get-connection-counts-to-server-application-appinstance-and-stream/43/5 "2010-07-27T22:36:49Z")

</div>

Wouldn’t this be a better starting place:

[http://community.wowza.com/t/-/60](http://community.wowza.com/t/-/60)

Richard
