Hi Emmanuel,

I'm using Mina 2.0, RC1.

> Can you provide your decoder code ?

Well, I gave up on my own decoder because I saw PrefixedStringCodecFactory 
already exists.
All I'm doing currently is adding it to the filter.

ProtocolCodecFactory factory = new PrefixedStringCodecFactory();
chain.addLast("codec", new ProtocolCodecFilter(factory));

The issue is that I will be sending the string from a C++ socket, so I can't 
just use putPrefixedString().  When my test client uses the code I provided 
before, (i.e., wr.write(myString.length()); wr.write(myString);)  I get the 
following at the INFO level, which is before any of my code in 
messageReceived() runs.  Obviously the dataLength is over the top.

INFO: RECEIVED: HeapBuffer[pos=0 lim=2048 cap=2048: 05 3C 3F 78 6D 6C 20 76 65 
72 73 69 6F 6E 3D 27...]
org.apache.mina.filter.codec.ProtocolDecoderException: 
org.apache.mina.core.buffer.BufferDataException: dataLength: 87834488 (Hexdump: 
05 3C ...blah blah)
    at 
org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:235)

This suggests I am not emulating putPrefixedString correctly.

Regards,
Daniel
                                          
_________________________________________________________________
Hotmail is redefining busy with tools for the New Busy. Get more from your 
inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2

Reply via email to