On Tue, Jan 26, 2010 at 7:20 PM, Frederic Soulier
<fred.soulier...@googlemail.com> wrote:
> 2010/1/26 Ashish <paliwalash...@gmail.com>
>
>> On Tue, Jan 26, 2010 at 4:41 PM, Frederic Soulier
>> <fred.soulier...@googlemail.com> wrote:
>> > Hi
>> >
>> > Using 2.0 RC1 I've got the following filter chain configured for a
>> > NioSocketAcceptor:
>> >
>> > acceptor.getFilterChain().addLast("blacklist", new BlacklistFilter());
>> > acceptor.getFilterChain().addLast("connection", new ConnectionFilter());
>> > acceptor.getFilterChain().addLast("proto", new ProtocolCodecFilter(new
>> > MyProtocolEncoder(), new MyProtocolDecoder()));
>> > acceptor.getFilterChain().addLast("pool", new ExecutorFilter(new
>> > OrderedThreadPoolExecutor()));
>> > acceptor.setHandler(new MyHandler());
>> >
>> > I see some strange output when sending data (write) back to the clients.
>> >
>> > In my ConnectionFilter I've overriden the MessageSent method with:
>> >
>> > @Override
>> > public void messageSent(NextFilter nextFilter, IoSession ios,
>> WriteRequest
>> > writeRequest)
>> > throws Exception
>> > {
>> > log.trace("Sent(wire)     [{}b] [{}].",
>> >        ((IoBuffer)writeRequest.getMessage()).remaining(),
>> > ((IoBuffer)writeRequest.getMessage()).getHexDump());
>> > }
>>
>> One thing that is missing is call to nextFilter.messageSent()
>>
>> > In my logs I can see what is sent down the wire
>> > 11:00:20,157 Sent(wire)     [52b] [00 00 00 30 9A 47 A7 CE 33 C6 AC 72 CE
>> 08
>> > 79 A8 70 0C 1D 41 87 B1 2F D2 53 42 B7 85 B7 91 59 30 02 44 A0 42 00 50
>> 28
>> > 8D D3 4B 04 74 58 70 58 26 9E 46 35 C1].
>> >
>> > but somehow I immediately get an empty WriteRequest...
>> >
>> > 11:00:20,157 Sent(wire)     [0b] [empty].
>>
>> Hmm.. not sure abt this. Are both these traces from same snippet that
>> you posted above?
>>
>> > Why is that?
>> >
>>
>>
>
> Yep the logging is from the same messageSent() and my cut&paste was wrong...
>
> @Override
> public void messageSent(NextFilter nextFilter, IoSession ios, WriteRequest
> writeRequest)
> throws Exception
> {
> log.trace("Sent(wire)     [{}b] [{}].",
> ((IoBuffer)writeRequest.getMessage()).remaining(),
> ((IoBuffer)writeRequest.getMessage()).getHexDump());
> super.messageSent(nextFilter, ios, writeRequest);
> }
>
> I've only started dabbling with MINA 2.0 RC1 recently.  I can't remember
> seing this with MINA 1.1.7
>
> Fred
>

Fred, Can you provide me a test to reproduce this. I guess I am lost
here. I am not sure if your message is complete or not, meaning have
all the necessary bytes sent to client or not?


-- 
thanks
ashish

Blog: http://www.ashishpaliwal.com/blog
My Photo Galleries: http://www.pbase.com/ashishpaliwal

Reply via email to