On 7/26/07, alimli <[EMAIL PROTECTED]> wrote:
Trustin Lee wrote:
>
> You are using TextLineDecoder in a wrong way. I'd suggest the
> following implementation:
>
> 1) Use TextLineDecoder as it is; do not extend it.
> 2) Once you inserted your protocol codec filter, your IoHandler's
> messageReceived() will be provided with a line of string.
Thanks for your reply, Trustin. I change my implementation according to your
advice.
But again, default TextLineCodecFactory does not work well with windows.
Messages sent to client are only terminated with 0A character.
Default TextLineCodecFactory uses a TextLineDecoder with
LineDelimiter.UNIX. I guess Windows telnet client doesn't understand
UNIX line delimiter. I'd suggest you to try PuTTY.
To fix this linedelimeter problem, I wrote a new codec factory with
encoder = new TextLineEncoder(Charset.forName("UTF-8"),
LineDelimiter.WINDOWS);
decoder = new TextLineDecoder(Charset.forName("UTF-8"),
LineDelimiter.WINDOWS);
Interestingly, this works fine both from windows telnet and solaris telnet.
Right. Most UNIX systems understand windows line delimiter.
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6