users@grizzly.java.net

Re: Track active clients using Connection or FilterChainContext

From: LongkerDandy <longkerdandy_at_gmail.com>
Date: Fri, 13 Jun 2014 09:45:51 +0800

Hi Alexey

That's very clear, thanks.
I can wait to Grizzly 2.4.x to apply the change.

Regards
LongkerDandy


On Fri, Jun 13, 2014 at 9:15 AM, Oleksiy Stashok <oleksiy.stashok_at_oracle.com
> wrote:

> Hey,
>
>
> On 12.06.14 17:59, LongkerDandy wrote:
>
>> I have a TCP serevr and I want to track all active clients connection,
>> so clients can send message to each other.
>> For now I'm using Grizzly's util DataStructures to maintain client'id and
>> FilterChainContext in a map.
>> I wondered:
>>
>> 1. Should using Connection instead of FilterChainContext. It seems more
>> lightweight and Grizzly's auth sample is using Connection.
>>
> It's possible, the only downside is that you can't use Connection.write()
> for Connections, that use port unification.
>
>
> 2. If a send message via Connection.write(...), will it still trigger
>> filtter chain correctly?
>>
> Yes, but as I mentioned it won't work with port unification.
>
> We have that fixed on Grizzly master, where instead of tracking unified
> protocol through BackChannelFilter - we just create a new FilterChain with
> recognized protocol in it and assign this FilterChain to the Connection.
> Probably we have to find time and backport that change to Grizzly 2.3.x.
>
> Thanks.
>
> WBR,
> Alexey.
>