UDP state

pkwarren pkwarren at gmail.com
Mon Jun 29 17:17:38 EDT 2009


I have tried to create a UDP protocol handler in Netty using the OIO UDP
handler, however I can't figure out how to store state in my handler. I have
tried using a custom ChannelPipelineFactory which returns a new instance of
my handler with each call to getPipeline(), but I'm finding that every
message which comes in occurs on the same instance of the handler. Since the
same handler is used for each message, I also don't think I can use
ChannelHandlerContext.setAttachment() or ChannelLocal() to store state.

Does anyone know how to enable saving some state as part of a UDP pipeline?
In particular, I'm looking to save off some information in the
messageReceived() method that could be used in the exceptionCaught() method
to simplify error handling.
-- 
View this message in context: http://n2.nabble.com/UDP-state-tp3177229p3177229.html
Sent from the Netty User Group mailing list archive at Nabble.com.




More information about the netty-users mailing list