You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by liquidchen <li...@gmail.com> on 2007/10/04 05:47:26 UTC

IoSocketConnector max connection

Hi, 
      In the trunk version, can we limit the max connections for
IoSocketConnector?? like a 
   socket connection pool, because I dont want to connect to many connection
to the server
   program, thanks a lot...
-- 
View this message in context: http://www.nabble.com/IoSocketConnector-max-connection-tf4565665s16868.html#a13032106
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: IoSocketConnector max connection

Posted by Mike Heath <mh...@apache.org>.
liquidchen wrote:
> So, if I just want to control the max connection number to the remote site,
> what will be the best solution to do this?? Use IoFilter to control it?? But
> I dont want to close new incoming connection if max connection number reach,
> I just want to block it to wait connection release for a while, thanks for
> any suggestion...

Could you just use java.util.concurrent.Semaphore?

-Mike

Re: IoSocketConnector max connection

Posted by liquidchen <li...@gmail.com>.
It's working like a http proxy, one side is a http server, get message from
http client and
forward it to another tcp server, but the tcp server has limitation on
concurrent connections

mat-29 wrote:
> 
> Is it load balancing's job?
> 
> On 10/8/07, liquidchen <li...@gmail.com> wrote:
>>
>>
>> So, if I just want to control the max connection number to the remote
>> site,
>> what will be the best solution to do this?? Use IoFilter to control it??
>> But
>> I dont want to close new incoming connection if max connection number
>> reach,
>> I just want to block it to wait connection release for a while, thanks
>> for
>> any suggestion...
>>
>> Mike Heath-4 wrote:
>> >
>> > I agree that I don't think this is the job of the IoSocketConnector.
>> > However, it should be fairly easy in trunk to create a meta
>> > SocketConnector that limits how many connections can be open at a time.
>> >   This might be good functionality to add along with proxy and auto
>> > reconnect support.
>> >
>> > -Mike
>> >
>> > mat wrote:
>> >> I doubt whether it is supposed to be the part of IoSocketConnector's
>> job?
>> >>
>> >> On 10/4/07, liquidchen <li...@gmail.com> wrote:
>> >>>
>> >>> Hi,
>> >>>      In the trunk version, can we limit the max connections for
>> >>> IoSocketConnector?? like a
>> >>>   socket connection pool, because I dont want to connect to many
>> >>> connection
>> >>> to the server
>> >>>   program, thanks a lot...
>> >>> --
>> >>> View this message in context:
>> >>>
>> http://www.nabble.com/IoSocketConnector-max-connection-tf4565665s16868.html#a13032106
>> >>> Sent from the Apache MINA Support Forum mailing list archive at
>> >>> Nabble.com
>> >>> .
>> >>>
>> >>>
>> >>
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/IoSocketConnector-max-connection-tf4565665s16868.html#a13089750
>> Sent from the Apache MINA Support Forum mailing list archive at
>> Nabble.com
>> .
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/IoSocketConnector-max-connection-tf4565665s16868.html#a13133181
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: IoSocketConnector max connection

Posted by mat <fo...@gmail.com>.
Is it load balancing's job?

On 10/8/07, liquidchen <li...@gmail.com> wrote:
>
>
> So, if I just want to control the max connection number to the remote
> site,
> what will be the best solution to do this?? Use IoFilter to control it??
> But
> I dont want to close new incoming connection if max connection number
> reach,
> I just want to block it to wait connection release for a while, thanks for
> any suggestion...
>
> Mike Heath-4 wrote:
> >
> > I agree that I don't think this is the job of the IoSocketConnector.
> > However, it should be fairly easy in trunk to create a meta
> > SocketConnector that limits how many connections can be open at a time.
> >   This might be good functionality to add along with proxy and auto
> > reconnect support.
> >
> > -Mike
> >
> > mat wrote:
> >> I doubt whether it is supposed to be the part of IoSocketConnector's
> job?
> >>
> >> On 10/4/07, liquidchen <li...@gmail.com> wrote:
> >>>
> >>> Hi,
> >>>      In the trunk version, can we limit the max connections for
> >>> IoSocketConnector?? like a
> >>>   socket connection pool, because I dont want to connect to many
> >>> connection
> >>> to the server
> >>>   program, thanks a lot...
> >>> --
> >>> View this message in context:
> >>>
> http://www.nabble.com/IoSocketConnector-max-connection-tf4565665s16868.html#a13032106
> >>> Sent from the Apache MINA Support Forum mailing list archive at
> >>> Nabble.com
> >>> .
> >>>
> >>>
> >>
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/IoSocketConnector-max-connection-tf4565665s16868.html#a13089750
> Sent from the Apache MINA Support Forum mailing list archive at Nabble.com
> .
>
>

Re: IoSocketConnector max connection

Posted by liquidchen <li...@gmail.com>.
So, if I just want to control the max connection number to the remote site,
what will be the best solution to do this?? Use IoFilter to control it?? But
I dont want to close new incoming connection if max connection number reach,
I just want to block it to wait connection release for a while, thanks for
any suggestion...

Mike Heath-4 wrote:
> 
> I agree that I don't think this is the job of the IoSocketConnector. 
> However, it should be fairly easy in trunk to create a meta 
> SocketConnector that limits how many connections can be open at a time. 
>   This might be good functionality to add along with proxy and auto 
> reconnect support.
> 
> -Mike
> 
> mat wrote:
>> I doubt whether it is supposed to be the part of IoSocketConnector's job?
>> 
>> On 10/4/07, liquidchen <li...@gmail.com> wrote:
>>>
>>> Hi,
>>>      In the trunk version, can we limit the max connections for
>>> IoSocketConnector?? like a
>>>   socket connection pool, because I dont want to connect to many
>>> connection
>>> to the server
>>>   program, thanks a lot...
>>> --
>>> View this message in context:
>>> http://www.nabble.com/IoSocketConnector-max-connection-tf4565665s16868.html#a13032106
>>> Sent from the Apache MINA Support Forum mailing list archive at
>>> Nabble.com
>>> .
>>>
>>>
>> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/IoSocketConnector-max-connection-tf4565665s16868.html#a13089750
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: IoSocketConnector max connection

Posted by Mike Heath <mh...@apache.org>.
I agree that I don't think this is the job of the IoSocketConnector. 
However, it should be fairly easy in trunk to create a meta 
SocketConnector that limits how many connections can be open at a time. 
  This might be good functionality to add along with proxy and auto 
reconnect support.

-Mike

mat wrote:
> I doubt whether it is supposed to be the part of IoSocketConnector's job?
> 
> On 10/4/07, liquidchen <li...@gmail.com> wrote:
>>
>> Hi,
>>      In the trunk version, can we limit the max connections for
>> IoSocketConnector?? like a
>>   socket connection pool, because I dont want to connect to many
>> connection
>> to the server
>>   program, thanks a lot...
>> --
>> View this message in context:
>> http://www.nabble.com/IoSocketConnector-max-connection-tf4565665s16868.html#a13032106
>> Sent from the Apache MINA Support Forum mailing list archive at Nabble.com
>> .
>>
>>
> 


Re: IoSocketConnector max connection

Posted by mat <fo...@gmail.com>.
I doubt whether it is supposed to be the part of IoSocketConnector's job?

On 10/4/07, liquidchen <li...@gmail.com> wrote:
>
>
> Hi,
>      In the trunk version, can we limit the max connections for
> IoSocketConnector?? like a
>   socket connection pool, because I dont want to connect to many
> connection
> to the server
>   program, thanks a lot...
> --
> View this message in context:
> http://www.nabble.com/IoSocketConnector-max-connection-tf4565665s16868.html#a13032106
> Sent from the Apache MINA Support Forum mailing list archive at Nabble.com
> .
>
>