i add ReadThrottleFilterBuilder in my code ,but find it's invalid .
my code is :
IoAcceptor acceptor = new SocketAcceptor(num,
Executors.newCachedThreadPool());
IoAcceptorConfig config = new SocketAcceptorConfig();
config.setThreadModel(ThreadModel.MANUAL);
DefaultIoFilterChainBuilder chain = config.getFilterChain();
chain.addLast("codec",new ProtocolCodecFilter(new
TextLineCodecFactory()));
chain.addLast("threadPool", new
ExecutorFilter(Executors.newCachedThreadPool()));
UICReadThrottleFilterBuilder readThrottleFilterBuilder = new
UICReadThrottleFilterBuilder();
readThrottleFilterBuilder.attach(chain);
acceptor.bind(new InetSocketAddress(PORT), new
EchoProtocolHandler1(),
config);
....................
i find in sourcecode :
if (message instanceof ByteBuffer) {
add(session, ((ByteBuffer) message).remaining());
}
and at this time message is not the instanceof ByteBuffer so add function
will never be executed!
Trustin Lee wrote:
>
> On 10/26/07, tiandike <[EMAIL PROTECTED]> wrote:
>>
>> I find in ExecutorFilter the request will be wrapped in event and put
>> in
>> SessionBuffer.eventQueue field .
>> If my handler handle request slow and client send request faster ,will
>> the
>> size of eventQueue became huge and lead to OutofMemoryException error?
>
> Yes. That's why you need to use ReadThrottleFilterBuilder.
>
> HTH,
> Trustin
> --
> what we call human nature is actually human habit
> --
> http://gleamynode.net/
> --
> PGP Key ID: 0x0255ECA6
>
>
--
View this message in context:
http://www.nabble.com/a-question-about-SessionBuffer-tf4695808s16868.html#a13463313
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.