mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From daniel vettori <daniel.vettori...@gmail.com>
Subject Re: multiple delimiters support with apache mina
Date Tue, 04 Sep 2012 05:31:19 GMT
On Tue, Sep 4, 2012 at 8:44 AM, Emmanuel Lécharny <elecharny@gmail.com>wrote:

> Le 9/3/12 3:36 PM, daniel vettori a écrit :
>
>  Hi,
>>
>> I m using Apache mina in my socket component. I used TextLineDecoder as my
>> sample for my Socket component. In my component i m using single delimiter
>> as end of message to/from socket. Now, i want to implement same thing with
>> multiple delimiters support.
>> Supposee i have message as (with delimiters ; :  ,)
>> this;is:sample,
>>
>> and output as
>> this
>> is
>> sample
>>
>> So,how should i approach for this problem...
>>
>
> The best solution would be to write your own version of the
> TextLinedecoer, a version accepting more than one delimiter.
>
> Just have a look at the TexlineDecoder code, you should be able to extend
> it to get what you need.
> http://mina.apache.org/report/**trunk/xref/org/apache/mina/**
> filter/codec/textline/**TextLineDecoder.html<http://mina.apache.org/report/trunk/xref/org/apache/mina/filter/codec/textline/TextLineDecoder.html>
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>

Hi,
I agree with you. For time being what i m doing is for the delimiter string
, i take multiple delimters separated by space and then have the delimiters
in the Stringbuffer and  convert them to byte buffer.Comparing the
delimiters bytebuffer with the input bytebuffer.what i m facing problem is
,then i have to compare the result and keep it in separate decoded buffer
......

Thanks
Daniel

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message