Sorry, I should have provided more information but was in hurry to post the
question. I'm using MINA 2.0.0-M6 with the TextLineCodecFactory and US-ASCII
Charset. In my handler/messageReceived method I'm just calling:
String str = msg.toString();
System.out.println("Message received: [" + str + "]");
The string that is being sent to the server is something like:
1234567890NULL03|Othertext
Where NULL above is the Null character I'm talking about.
So, what gets printed out from the System.out is "[1234567890]" and I don't
know what's happening to the remainder of the string.
Any thoughts/suggestions?
Thanks,
David
-----Original Message-----
From: Emmanuel Lecharny [mailto:[email protected]] On Behalf Of Emmanuel
Lecharny
Sent: Wednesday, September 16, 2009 10:48 AM
To: [email protected]
Subject: Re: Null Character in Received Message/String
Sica, David (David) wrote:
> I have a process that is sending an ASCII string that contains a Null
> Character in the middle of the string. It seems that my MINA server is
> only receiving the string before the Null Character and then ignoring
> everything after. Does this seem consistent with how MINA should be
> handling it and if so how do I change it to be able to receive the
> entire string including text after the null character?
>
You should check your decoder. MINA does not care about \0 bytes, they
are just plain normal bytes to it.
PS : Please when you post on this list, provide the MINA version you are
using.
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org