UDP state

Neil Avery neil at liquidlabs.co.uk
Tue Jun 30 02:15:36 EDT 2009


Im pretty sure you can only attach state using TCP,  UDP is connectionless
so there is no way of determining a client socket session (cause there isnt
one) - however it would be possible to
pass through a client UUID as part of each message header and use it to
associate state - just a thought



2009/6/29 pkwarren <pkwarren at gmail.com>

>
> 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.
>
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20090630/3723aaf9/attachment.html 


More information about the netty-users mailing list