You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Stanley Ding <gh...@hotmail.com> on 2008/10/17 14:09:45 UTC

Some questions about NioSocketConnector

1、Can I add an executor filter before the codec filter?
2、When I add the executor before the codec filter, some times mina creates more than one Decoder instances for only one session [CodecFactory.getDecoder() is called more than once]. Why? 
3、When I add the executor before the codec filter, and there're many messages to decode, all threads in the pool are used to decode the messages, but I found that the Decoders are called in regular sequence: 1-start -〉1-end -> 2-start -> 2-end -> 3-start -> 3-end, never found 1-start -> 2-start ->1-end -> 2-end... How can you do that?
 
 
_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx

Re: Some questions about NioSocketConnector

Posted by Maarten Bosteels <mb...@gmail.com>.
Adding an executor filter before the decoder should work.
Please create a JIRA issue when it's not working.

Thanks,
Maarten

2008/10/18 Stanley Ding <gh...@hotmail.com>

>
> Because decoding messages is a heavy job in my system:
> decryption,validation..... It's good if I can use a thread pool to do
> decoding job.
>
> I added a thread pool before codec filter and tested it very carefully, but
> it works correctly, no problem.  I just worry about the thread conflict
> problem and want to know why it does not happen.
>
> If executor filter is not allowed to add before the codec filter, I'll try
> to do the decryption, validation job in a new filter.
>
>
>
> > Date: Fri, 17 Oct 2008 14:38:38 +0200> To: dev@mina.apache.org> Subject:
> Re: Some questions about NioSocketConnector> From: elecharny@gmail.com> >
> Stanley Ding wrote:> > 1、Can I add an executor filter before the codec
> filter?> > > > 2、When I add the executor before the codec filter, some times
> mina creates more than one Decoder instances for only one session
> [CodecFactory.getDecoder() is called more than once]. Why? > > 3、When I add
> the executor before the codec filter, and there're many messages to decode,
> all threads in the pool are used to decode the messages, but I found that
> the Decoders are called in regular sequence: 1-start -〉1-end -> 2-start ->
> 2-end -> 3-start -> 3-end, never found 1-start -> 2-start ->1-end ->
> 2-end... How can you do that?> > > > Why would you do that for a Connector?
> You are supposed to be a client,> not a server. Any special needs ?> > -- >
> --> cordialement, regards,> Emmanuel Lécharny> www.iktek.com>
> directory.apache.org> >
> _________________________________________________________________
> Discover the new Windows Vista
> http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
>

RE: Some questions about NioSocketConnector

Posted by Stanley Ding <gh...@hotmail.com>.
 
Because decoding messages is a heavy job in my system: decryption,validation..... It's good if I can use a thread pool to do decoding job.
 
I added a thread pool before codec filter and tested it very carefully, but it works correctly, no problem.  I just worry about the thread conflict problem and want to know why it does not happen.  
 
If executor filter is not allowed to add before the codec filter, I'll try to do the decryption, validation job in a new filter. 



> Date: Fri, 17 Oct 2008 14:38:38 +0200> To: dev@mina.apache.org> Subject: Re: Some questions about NioSocketConnector> From: elecharny@gmail.com> > Stanley Ding wrote:> > 1、Can I add an executor filter before the codec filter?> > > > 2、When I add the executor before the codec filter, some times mina creates more than one Decoder instances for only one session [CodecFactory.getDecoder() is called more than once]. Why? > > 3、When I add the executor before the codec filter, and there're many messages to decode, all threads in the pool are used to decode the messages, but I found that the Decoders are called in regular sequence: 1-start -〉1-end -> 2-start -> 2-end -> 3-start -> 3-end, never found 1-start -> 2-start ->1-end -> 2-end... How can you do that?> > > > Why would you do that for a Connector? You are supposed to be a client,> not a server. Any special needs ?> > -- > --> cordialement, regards,> Emmanuel Lécharny> www.iktek.com> directory.apache.org> > 
_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE

Re: Some questions about NioSocketConnector

Posted by Emmanuel Lecharny <el...@gmail.com>.
Stanley Ding wrote:
> 1、Can I add an executor filter before the codec filter?
>   
> 2、When I add the executor before the codec filter, some times mina creates more than one Decoder instances for only one session [CodecFactory.getDecoder() is called more than once]. Why? 
> 3、When I add the executor before the codec filter, and there're many messages to decode, all threads in the pool are used to decode the messages, but I found that the Decoders are called in regular sequence: 1-start -〉1-end -> 2-start -> 2-end -> 3-start -> 3-end, never found 1-start -> 2-start ->1-end -> 2-end... How can you do that?
>   

Why would you do that for a Connector? You are supposed to be a client,
not a server. Any special needs ?

-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org