How to determine active socket connection count?

Iain McGinniss iainmcgin at gmail.com
Thu Jul 23 10:38:44 EDT 2009


Hi Neil,

You'll need to add the specific connections that are accepted by your  
server socket using a ChannelHandler. See the JavaDoc of ChannelGroup  
for an example:

http://www.jboss.org/file-access/default/members/netty/freezone/api/3.1/org/jboss/netty/channel/group/ChannelGroup.html

Iain

On 23 Jul 2009, at 15:28, neilson9 wrote:

>
> Thanks trustin, my Server does something like,
>
> DefaultChannelGroup allChannels  = new
> DefaultChannelGroup("netty-receiver");
> Channel bind = bootstrap.bind(new  
> InetSocketAddress(endPoint.getPort()));
> allChannels.add(bind);
>
> however allChannels.size() is always 1 -(when I have many active
> connections)...
>
> Cheers Neil.
>
>
> On Thu, Jul 23, 2009 at 10:07 AM, Trustin Lee (via Nabble) <
> ml-user+57722-1440662075 at n2.nabble.com<ml-user%2B57722-1440662075 at n2.nabble.com 
> >
>> wrote:
>
>> Hi Neil,
>>
>> Create a ChannelGroup and add the Channels to it then you can get the
>> number of established channels.
>>
>> HTH,
>> Trustin
>>
>> On 07/23/2009 05:12 PM, neilson9 wrote:
>>> Hi,
>>> Im trying to determine the 'Established' socket connection/channel  
>>> count
>> a
>>> NioServerSocketChannel.
>>>
>>> Is there a way of doing this?
>>>
>>> I looked through the API but havent had any luck so far
>>>
>>> Cheers Neil.
>>
>> _______________________________________________
>> netty-users mailing list
>> netty-users at ...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3308378&i=0 
>> >
>> https://lists.jboss.org/mailman/listinfo/netty-users
>> — Trustin Lee, http://gleamynode.net/
>>
>>
>> ------------------------------
>> View message @
>> http://n2.nabble.com/How-to-determine-active-socket-connection-count--tp3308167p3308378.html
>> To unsubscribe from How to determine active socket connection  
>> count?, click
>> here< (link removed) =>.
>>
>>
>>
>
> -- 
> View this message in context: http://n2.nabble.com/How-to-determine-active-socket-connection-count--tp3308167p3309906.html
> Sent from the Netty User Group mailing list archive at Nabble.com.
>
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users




More information about the netty-users mailing list