Channel attachments?
blakeman8192
blakeman8192 at hotmail.com
Thu Jun 10 16:46:17 EDT 2010
I've used MINA, which was made by the same developer.
MINA used to have setAttachment(Object) and getAttachment() methods, then
later got setAttribute(String, Object) and getAttribute(String) methods.
These are really convenient.
Netty doesn't seem to have any methods of the sort for Channel.
I know that Netty has setAttachment(Object) and getAttachment() for a
ChannelHandlerContext, but in the server I'm developing, there are different
decoders that replace each other. I need some way to keep track of
attributes for a Channel, not a ChannelHandlerContext because the
ChannelHandlerContexts do change so what I attach to one will not be a part
of another.
I've noticed ChannelLocal, but there is no method to get a ChannelLocal
object for a Channel. It also seems pretty redundant to use a Map<Channel,
ChannelLocal> to keep track of ChannelLocal objects for Channels.
I need a more elegant way to keep track of different objects (i.e. a Player
object) for a Channel.
Is this overlooked in the Netty design, or (more likely) am I missing
something?
Thanks for your time,
-Blake
--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Channel-attachments-tp5165235p5165235.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list