-
Notifications
You must be signed in to change notification settings - Fork 13
Description
There is a requirement in my project to obtain Host Address of the sender from the UDP Header for processing the request. As per my understanding, I need to add a handler using which I will get DatagramPacket. So, I modified the usage example given in https://github.com/Shevchik/UdpServerSocketChannel by replacing:
private static class Echo extends SimpleChannelInboundHandler
with
public static class Echo extends SimpleChannelInboundHandler.
The modified example is attached.
But, protected void channelRead0(ChannelHandlerContext channelHandlerContext, DatagramPacket datagramPacket) throws Exception is not invoked at all. It may be because the library (UdpServerSocketChannel) already has a similar handler
| ioChannel.pipeline().addLast(ioReadRoute); |
protected class ReadRouteChannelHandler extends SimpleChannelInboundHandler {
Can you please let me know if the above solution which I am trying can be made to work? If not, please let me know any alternate solution which I can try.
Thanks!