Im pretty sure you can only attach state using TCP, UDP is connectionless so <div>there is no way of determining a client socket session (cause there isnt one) - however it would be possible to </div><div>pass through a client UUID as part of each message header and use it to associate state - just a thought </div>
<div><br></div><div><br><br><div class="gmail_quote">2009/6/29 pkwarren <span dir="ltr"><<a href="mailto:pkwarren@gmail.com">pkwarren@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
I have tried to create a UDP protocol handler in Netty using the OIO UDP<br>
handler, however I can't figure out how to store state in my handler. I have<br>
tried using a custom ChannelPipelineFactory which returns a new instance of<br>
my handler with each call to getPipeline(), but I'm finding that every<br>
message which comes in occurs on the same instance of the handler. Since the<br>
same handler is used for each message, I also don't think I can use<br>
ChannelHandlerContext.setAttachment() or ChannelLocal() to store state.<br>
<br>
Does anyone know how to enable saving some state as part of a UDP pipeline?<br>
In particular, I'm looking to save off some information in the<br>
messageReceived() method that could be used in the exceptionCaught() method<br>
to simplify error handling.<br>
<font color="#888888">--<br>
View this message in context: <a href="http://n2.nabble.com/UDP-state-tp3177229p3177229.html" target="_blank">http://n2.nabble.com/UDP-state-tp3177229p3177229.html</a><br>
Sent from the Netty User Group mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
netty-users mailing list<br>
<a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>
</font></blockquote></div><br></div>