users@grizzly.java.net

Correct way to save state variable per connection

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

Hi

On TCP serevr side, I tried to save some state information per connection.
Like the user id which already logged in.
I'm trying use FilterChainContext.getAttributes().getAttribute and
setAttribute.
But seems I got a new FilterChainContext and new Filter instances everytime
new message arrived.
And my previous setted attributes are gone.

So, what is the correct way to keep this state information?

Regards
LongkerDandy