Thanks Ashish.  I'm not specifically setting a delimiter with 
TextLineCodecFactory.

I am including the LoggingFilter but I noticed that I didn't have the 
log4j.properties setup.  After adding that, I see in the console log that:

...LoggingFilter - RECEIVED: HeapBuffer[pos=0 lim=49 cap=2048: 31 30 30 33 37 
34 35 36 35 35 00 30 36 2F 31 35 ...]

But my message received only prints out [1003745655].  So, it seems that I'm 
receiving the entire message with the Null character but when I try to access 
it and print it out I'm losing everything after the Null.  Maybe it's something 
with toString or System.out that's choking on the Null?

David

-----Original Message-----
From: Ashish [mailto:[email protected]] 
Sent: Wednesday, September 16, 2009 10:29 PM
To: [email protected]
Subject: Re: Null Character in Received Message/String

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?

David,

What is the delimiter you are using with TextLineCodecFactory?

You can pass on your custom delimiter, in TextLineDecoder class.
You can also, put the LoggingFilter in the chain to see what messages
are being received by the Server.

thanks
ashish

Reply via email to