On Tue, Jan 26, 2010 at 4:41 PM, Frederic Soulier
<[email protected]> 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?
>
> Thx
> Fred
>



-- 
thanks
ashish

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

Reply via email to