You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by da...@daune-consult.com on 2006/06/22 10:28:10 UTC

Handling two protocols

Hi,

I am writing an application that must handle two protocols on separate ports.

I wonder if I should declare two SocketAcceptors, or one with two bindings.

It is not clear for me what are the pros/cons of those two configs.

Regards,

J-F



Re: Handling two protocols

Posted by peter royal <pr...@apache.org>.
On Jun 22, 2006, at 1:13 PM, daune.jf@daune-consult.com wrote:
> Quoting peter royal <pr...@apache.org>:
>
>> On Jun 22, 2006, at 4:28 AM, daune.jf@daune-consult.com wrote:
>>> I am writing an application that must handle two protocols on    
>>> separate ports.
>>>
>>> I wonder if I should declare two SocketAcceptors, or one with  
>>> two  bindings.
>>>
>>> It is not clear for me what are the pros/cons of those two configs.
>>
>> You only need a single SocketAcceptor, and then bind to it twice,   
>> once
>> for each port.
>> -pete
>>
>> -- 
>> proyal@apache.org - http://fotap.org/~osi
>
>
> What is shared in this case (filters, config, thread pool...)?

any filters that are part of the configuration of the Acceptor will  
be shared. Per-service filters should be added on the configuration  
that you can pass into the bind() method. A thread pool will be  
shared by default, but that's fine.

-pete

-- 
proyal@apache.org - http://fotap.org/~osi



Re: Handling two protocols

Posted by da...@daune-consult.com.
Quoting peter royal <pr...@apache.org>:

> On Jun 22, 2006, at 4:28 AM, daune.jf@daune-consult.com wrote:
>> I am writing an application that must handle two protocols on    
>> separate ports.
>>
>> I wonder if I should declare two SocketAcceptors, or one with two  bindings.
>>
>> It is not clear for me what are the pros/cons of those two configs.
>
> You only need a single SocketAcceptor, and then bind to it twice,  once
> for each port.
> -pete
>
> -- 
> proyal@apache.org - http://fotap.org/~osi


What is shared in this case (filters, config, thread pool...)?

J-F



Re: Handling two protocols

Posted by peter royal <pr...@apache.org>.
On Jun 22, 2006, at 4:28 AM, daune.jf@daune-consult.com wrote:
> I am writing an application that must handle two protocols on  
> separate ports.
>
> I wonder if I should declare two SocketAcceptors, or one with two  
> bindings.
>
> It is not clear for me what are the pros/cons of those two configs.

You only need a single SocketAcceptor, and then bind to it twice,  
once for each port.
-pete

-- 
proyal@apache.org - http://fotap.org/~osi