users@grizzly.java.net

Re: Do I have to remove the attribute when connection is closed.

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Date: Tue, 04 Nov 2014 10:41:22 -0800

Hi,

no, you don't have to remove attributes they have to be GC'ed (if there
are no other references).

WBR,
Alexey.

On 04.11.14 01:18, LongkerDandy wrote:
> Hi
>
> I've a TCP server, which using Conenction and Attribute to save user's
> auth information.
> Like this:
>
>
> private static final Attribute<Integer> ATTR_AUTH =
> Grizzly.DEFAULT_ATTRIBUTE_BUILDER.createAttribute("auth");
> public static void setAuthState(Connection connection, int authState) {
> ATTR_AUTH.set(connection, authState);
> }
>
>
> And I saw some strange logs, seems something when a client connected,
> it already have the attribute.
> I can't locate the problem, and I wondered do I need to remove the
> attributes when a connection is closed.
>
> Regards
> LongkerDandy