mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sungwon Jung" <the...@gmail.com>
Subject Re: text based protocol
Date Mon, 17 Sep 2007 08:22:47 GMT
Thanks Maarten Bosteels!


On 9/17/07, Maarten Bosteels <mbosteels.dns@gmail.com> wrote:
> Hello Sungwon,
>
> Please have a look at
> http://mina.apache.org/report/1.1/apidocs/org/apache/mina/filter/codec/textline/TextLineDecoder.html
>
> As the name suggests, the TextLineDecoder tries to decode a LINE of text: it
> accumulates all incoming data until it receives a Line Delimiter (carriage
> return or line-feed)
>
> Either your client should append a '\n' to the string it sends (instead of
> the '\0')
> or you should configure the TextLineDecoder to use '\0' as the
> LineDelimiter.
>
> Maarten
>
> On 9/17/07, Sungwon Jung <thedaz@gmail.com> wrote:
> >
> > Hello. I'm using MINA 1.1.2.
> >
> > problem is server cannot receive client's message.
> >
> > client code is below.
> > ---
> > char sBufSend[ 512 ] = "0123456789\0";
> > int iSend = 0;
> > iSend = send( scHost, sBufSend, strlen( sBufSend ), 0 );
> > printf( "%d\n", iSend );
> > --
> >
> > server use cfg.getFilterChain().addLast( "codec", new
> > ProtocolCodecFilter( new TextLineCodecFactory( Charset.forName(
> > "ASCII" ) ) ) );
> >
> > but server cannot receive "0123456789" that client sent message.
> >
> > what's the reason?
> >
> > Thank you.

Mime
View raw message