You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by satish viswanatham <sa...@gmail.com> on 2007/08/11 20:42:54 UTC
ProtocolCodecFilter (UTF-8 text line codec factory) is causing issues with UDP
Hi,
When I create the UDP acceptor with the following config -
cfg.getFilterChain().addLast("codec", new ProtocolCodecFilter(new
TextLineCodecFactory(Charset.forName("UTF-8"))));
My IoHandlerAdaptor's messageReceived is never called:
public void messageReceived(IoSession session, Object orig) throws
Exception;
I do see the following line, which tells me that MINA has received the
message, but not calling the IoHandlerAdaptor.
2007-08-11 01:40:33,477 [AnonymousIoService-1] INFO
com.jasperwireless.networktester.UdpServerHandler [null] - [/127.0.0.1:2291]
RECEIVED: HeapBuffer[pos=0 lim=500 cap=500: 00 .........]
Is this a known issue? Is there a work around? It is easy to reproduce. I
tried both on MINA 1.1.0 and MINA 1.1.1. Please let me know, if I should be
trying any work around or fix my code.
Thanks for your help.
Satish
Re: ProtocolCodecFilter (UTF-8 text line codec factory) is causing
issues with UDP
Posted by Eero Nevalainen <ee...@indagon.com>.
What are you using to generate your messages? What do you use as your
line delimiter?
-Eero Nevalainen
satish viswanatham wrote:
> Hi,
>
> When I create the UDP acceptor with the following config -
>
> cfg.getFilterChain().addLast("codec", new ProtocolCodecFilter(new
> TextLineCodecFactory(Charset.forName("UTF-8"))));
>
>
> My IoHandlerAdaptor's messageReceived is never called:
>
> public void messageReceived(IoSession session, Object orig) throws
> Exception;
>
> I do see the following line, which tells me that MINA has received the
> message, but not calling the IoHandlerAdaptor.
>
> 2007-08-11 01:40:33,477 [AnonymousIoService-1] INFO
> com.jasperwireless.networktester.UdpServerHandler [null] - [/127.0.0.1:2291]
> RECEIVED: HeapBuffer[pos=0 lim=500 cap=500: 00 .........]
>
> Is this a known issue? Is there a work around? It is easy to reproduce. I
> tried both on MINA 1.1.0 and MINA 1.1.1. Please let me know, if I should be
> trying any work around or fix my code.
>
> Thanks for your help.
>
> Satish
>