Seeing data corruption when using ChannelHandlerContext.set/getAttachement API
ovokinder
kindernade at gmail.com
Tue Jul 20 20:05:44 EDT 2010
Greg,
I have no idea about the getAttachment() issue but I believe it's safer for
you to use instance variables on the ServerHandler.
(Pardon me if you're already aware) Since that pipeline factory will create
a different ServerHandler for each new incoming connection, you can safely
keep per-connection state in instance variables.
Judging by the examples and documentation, I believe it's preferred over
storing data in the ChannelHandlerContext (if you add another ChannelHandler
that also stores data the attachment, they can't work together in the same
pipeline).
I'd only use attachments as a last resort, for those not-so-common cases
where one gets the opportunity to use a @Sharable ChannelHandler.
Cheers,
Bruno
--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Seeing-data-corruption-when-using-ChannelHandlerContext-set-getAttachement-API-tp5318952p5319065.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list