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/31 02:41:57 UTC

Client Connection Pool support

Hi, does mina Connector provide any function can do like sokcet connection
pool?? Thanks...
-- 
View this message in context: http://www.nabble.com/Client-Connection-Pool-support-tf4722391s16868.html#a13501459
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: Client Connection Pool support

Posted by Vishal_Jain <pi...@gmail.com>.
Thanks Frederic !

It really helps to know how this could be implemented :)
I would be trying out with a Manager class (something like a
connectionFactory) which abstracts the connection nitty-gritties. But as
Brad pointed out, i don't really need to worry abt pooling yet (since tomcat
on the other end can be configured for that), am hoping the short lived
connections will ensure only a few tens of connections at any given time.
(will stress test that after i implement).
and as for the hashmap - earlier i was using that approach but i felt
storing my state in the session object was much cleaner (and recommended by
the Mina community) .. so i'll go ahead with that.

I ran a profiler to check memory usage of the sample program i wrote. what i
am doing in this program is that i have a class extending the
IoHandlerAdaptor and i create a new instance of this in a thread for a
couple of hundred connections. what i didn't understand is that, after the
connection was closed, the memory used was still lurking around.  I tried
using a static instance of that class instead of new .. same behavior. i
must be missing something and would be grateful if someone can point that
out for me.

am attaching the file if that helps.

Thanks,
vishal http://www.nabble.com/file/p13619922/Client3.java Client3.java 

Frédéric Brégier wrote:
> 
> 
> In my project I use a pool of connections in one specific case since I
> have 
> the following situation :
> 1 Mina Main server gets transactions from outside applications (Mina
> client) 
> or users (Tomcat with a Mina connector).
> 
> Application Client makes one shot connection so there is no pool of 
> connection.
> But in Tomcat (web services), multiple users/threads from Tomcat can
> access 
> to the Mina Main server
> through a connection. I've done some benchmark and I saw a big improvement 
> using a pool of connection
> for Mina connector.
> For the implementation, I implement something close to the database pool
> of 
> connection.
> The code is quite not clear since it is inside the main project which is 
> quite complex, but
> if you think it could be useful, I can try to make a proposal of a subset
> of 
> code that helps.
> The main idea is at follow :
> - One class take the role of the pool of connections (static object in
> Java) 
> as with database pool.
>     Upper it, there is an hashmap bind to Mina Main server id (since in my 
> app there could be several Mina server
>     where Tomcat can connect to). If there is only one server as target, 
> this hashmap is unuseful.
>     In the pool of connections class, there is a Linked list of
> connections 
> and a counter of initialized connections.
> - One class take the role of a superset of Mina connections which includes
> a 
> pointer to the pool of connections.
>     The methode close is created to close "virtually" the connection, in 
> fact returning it into the linked list.
> - When 1 thread (Tomcat user) ask for a connection from the pool, the 
> scenario is as the following :
>     - if the list is empty, creates one new connection and return it.
>     - if the list is not empty, retrieve the first one (removing from the 
> list) and check if the connection is still ok
>         (using Mina method). If ok, it returns this connection. If not, 
> retry from the beginning.
> - When 1 thread close the connection, it is simply add to the list.
> The counter is used in order to not travel the linked list to count the 
> objects stored inside, so as to be efficient.
> 
> My benchmark were done with and without this pool. I cannot find right now 
> the numbers,
> but I remember it was really impressive (almost 5 time faster) under heavy 
> load.
> 
> Hoping this can help you
> 
> And finally for Trustin, my project is under production, at the time
> beeing 
> for a subset only,
> and we are waiting for the version 2 too since I saw that I need to change 
> quite a bit the code
> since last huge work you (all) have done !
> So keep the good job done ! Thank you for this great project !
> 
> Frederic
> ----- Original Message ----- 
> From: "Vishal_Jain"
> 
> Thanks Brad for pointing that out !
> 
> am using Mina because what we need is a proxy service and a server
> interface
> (2 connectors tunneling messages and an acceptor which channels data to
> one
> of the connectors .. )
> 
> will check out if Jakarta HTTP client can be used for this .. :)
> 
> -vishal
> 
> 
> Brad Harvey-2 wrote:
>>
>> Hi Vishal,
>>
>> If you're talking standard client side HTTP, MINA might not be the best
>> tool for the job.  For example, see
>> http://jakarta.apache.org/httpcomponents/httpclient-3.x/
>>
>> One of the features you might be interested in:
>> * Connection management support for use in multi-threaded applications.
>> Supports setting the maximum total connections as well as the maximum
>> connections per host. Detects and closes stale connections.
>>
>> Trustin mentioned that connection pools are useful when the cost of
>> connection is relatively high (eg, SSL handshake).  Another time they
>> are useful is when you want to limit the number of connections to the
>> server from a multi threaded client.  This is often to conserve
>> resources/limit load on the server.
>>
>> Cheers,
>> Brad.
>>
>> Vishal_Jain wrote:
>>> Thanks Trustin !
>>>
>>> The server i have at my disposal is within the LAN (same subnet) and the
>>> connection time i have noticed is about 50ms.
>>> My dilemma is to whether accept 50ms as acceptable/reasonable or try
>>> something to further reduce this.
>>> Purpose is to connect to a HTTP server (tomcat actually) and
>>> send/receive
>>> requests (socket would close after every transaction); my aim is to keep
>>> the
>>> system decently scalable with heavy loads (am not sure about how heavy
>>> it
>>> could get yet).
>>>
>>> - vishal
>>>
>>>
>>> Trustin Lee wrote:
>>>
>>>> On 11/6/07, Vishal_Jain <pi...@gmail.com> wrote:
>>>>
>>>>> Thats right.
>>>>> I was wondering if someone in this forum has implemented a connection
>>>>> pool
>>>>> (not necessarily around Mina) and perhaps share with rest of newbies
>>>>> like
>>>>> me
>>>>> ? :)
>>>>> Another doubt i have is regarding keeping a pool of 'connected'
>>>>> sockets.
>>>>> How
>>>>> useful is it to pull up a already connected socket and do a message
>>>>> exchange
>>>>> compared to creating and connecting a socket as and when required ?
>>>>>
>>>> I think it depends on the cost of making a connection.  It's often
>>>> very small and once connected, there's no problem with your bandwidth.
>>>>  If disconnection is unlikely, you could simply reconnect even if the
>>>> connection cost is somewhat high.
>>>>
>>>> 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/Client-Connection-Pool-support-tf4722391s16868.html#a13602821
> Sent from the Apache MINA Support Forum mailing list archive at
> Nabble.com.
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Client-Connection-Pool-support-tf4722391s16868.html#a13619922
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: Client Connection Pool support

Posted by Frédéric Brégier <fr...@free.fr>.
In my project I use a pool of connections in one specific case since I have 
the following situation :
1 Mina Main server gets transactions from outside applications (Mina client) 
or users (Tomcat with a Mina connector).

Application Client makes one shot connection so there is no pool of 
connection.
But in Tomcat (web services), multiple users/threads from Tomcat can access 
to the Mina Main server
through a connection. I've done some benchmark and I saw a big improvement 
using a pool of connection
for Mina connector.
For the implementation, I implement something close to the database pool of 
connection.
The code is quite not clear since it is inside the main project which is 
quite complex, but
if you think it could be useful, I can try to make a proposal of a subset of 
code that helps.
The main idea is at follow :
- One class take the role of the pool of connections (static object in Java) 
as with database pool.
    Upper it, there is an hashmap bind to Mina Main server id (since in my 
app there could be several Mina server
    where Tomcat can connect to). If there is only one server as target, 
this hashmap is unuseful.
    In the pool of connections class, there is a Linked list of connections 
and a counter of initialized connections.
- One class take the role of a superset of Mina connections which includes a 
pointer to the pool of connections.
    The methode close is created to close "virtually" the connection, in 
fact returning it into the linked list.
- When 1 thread (Tomcat user) ask for a connection from the pool, the 
scenario is as the following :
    - if the list is empty, creates one new connection and return it.
    - if the list is not empty, retrieve the first one (removing from the 
list) and check if the connection is still ok
        (using Mina method). If ok, it returns this connection. If not, 
retry from the beginning.
- When 1 thread close the connection, it is simply add to the list.
The counter is used in order to not travel the linked list to count the 
objects stored inside, so as to be efficient.

My benchmark were done with and without this pool. I cannot find right now 
the numbers,
but I remember it was really impressive (almost 5 time faster) under heavy 
load.

Hoping this can help you

And finally for Trustin, my project is under production, at the time beeing 
for a subset only,
and we are waiting for the version 2 too since I saw that I need to change 
quite a bit the code
since last huge work you (all) have done !
So keep the good job done ! Thank you for this great project !

Frederic
----- Original Message ----- 
From: "Vishal_Jain"

Thanks Brad for pointing that out !

am using Mina because what we need is a proxy service and a server interface
(2 connectors tunneling messages and an acceptor which channels data to one
of the connectors .. )

will check out if Jakarta HTTP client can be used for this .. :)

-vishal


Brad Harvey-2 wrote:
>
> Hi Vishal,
>
> If you're talking standard client side HTTP, MINA might not be the best
> tool for the job.  For example, see
> http://jakarta.apache.org/httpcomponents/httpclient-3.x/
>
> One of the features you might be interested in:
> * Connection management support for use in multi-threaded applications.
> Supports setting the maximum total connections as well as the maximum
> connections per host. Detects and closes stale connections.
>
> Trustin mentioned that connection pools are useful when the cost of
> connection is relatively high (eg, SSL handshake).  Another time they
> are useful is when you want to limit the number of connections to the
> server from a multi threaded client.  This is often to conserve
> resources/limit load on the server.
>
> Cheers,
> Brad.
>
> Vishal_Jain wrote:
>> Thanks Trustin !
>>
>> The server i have at my disposal is within the LAN (same subnet) and the
>> connection time i have noticed is about 50ms.
>> My dilemma is to whether accept 50ms as acceptable/reasonable or try
>> something to further reduce this.
>> Purpose is to connect to a HTTP server (tomcat actually) and send/receive
>> requests (socket would close after every transaction); my aim is to keep
>> the
>> system decently scalable with heavy loads (am not sure about how heavy it
>> could get yet).
>>
>> - vishal
>>
>>
>> Trustin Lee wrote:
>>
>>> On 11/6/07, Vishal_Jain <pi...@gmail.com> wrote:
>>>
>>>> Thats right.
>>>> I was wondering if someone in this forum has implemented a connection
>>>> pool
>>>> (not necessarily around Mina) and perhaps share with rest of newbies
>>>> like
>>>> me
>>>> ? :)
>>>> Another doubt i have is regarding keeping a pool of 'connected'
>>>> sockets.
>>>> How
>>>> useful is it to pull up a already connected socket and do a message
>>>> exchange
>>>> compared to creating and connecting a socket as and when required ?
>>>>
>>> I think it depends on the cost of making a connection.  It's often
>>> very small and once connected, there's no problem with your bandwidth.
>>>  If disconnection is unlikely, you could simply reconnect even if the
>>> connection cost is somewhat high.
>>>
>>> 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/Client-Connection-Pool-support-tf4722391s16868.html#a13602821
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.



Re: Client Connection Pool support

Posted by Vishal_Jain <pi...@gmail.com>.
Thanks Brad for pointing that out !

am using Mina because what we need is a proxy service and a server interface
(2 connectors tunneling messages and an acceptor which channels data to one
of the connectors .. )

will check out if Jakarta HTTP client can be used for this .. :)

-vishal


Brad Harvey-2 wrote:
> 
> Hi Vishal,
> 
> If you're talking standard client side HTTP, MINA might not be the best 
> tool for the job.  For example, see 
> http://jakarta.apache.org/httpcomponents/httpclient-3.x/
> 
> One of the features you might be interested in:
> * Connection management support for use in multi-threaded applications. 
> Supports setting the maximum total connections as well as the maximum 
> connections per host. Detects and closes stale connections.
> 
> Trustin mentioned that connection pools are useful when the cost of 
> connection is relatively high (eg, SSL handshake).  Another time they 
> are useful is when you want to limit the number of connections to the 
> server from a multi threaded client.  This is often to conserve 
> resources/limit load on the server.
> 
> Cheers,
> Brad.
> 
> Vishal_Jain wrote:
>> Thanks Trustin !
>>
>> The server i have at my disposal is within the LAN (same subnet) and the
>> connection time i have noticed is about 50ms.
>> My dilemma is to whether accept 50ms as acceptable/reasonable or try
>> something to further reduce this.
>> Purpose is to connect to a HTTP server (tomcat actually) and send/receive
>> requests (socket would close after every transaction); my aim is to keep
>> the
>> system decently scalable with heavy loads (am not sure about how heavy it
>> could get yet).
>>
>> - vishal
>>
>>
>> Trustin Lee wrote:
>>   
>>> On 11/6/07, Vishal_Jain <pi...@gmail.com> wrote:
>>>     
>>>> Thats right.
>>>> I was wondering if someone in this forum has implemented a connection
>>>> pool
>>>> (not necessarily around Mina) and perhaps share with rest of newbies
>>>> like
>>>> me
>>>> ? :)
>>>> Another doubt i have is regarding keeping a pool of 'connected'
>>>> sockets.
>>>> How
>>>> useful is it to pull up a already connected socket and do a message
>>>> exchange
>>>> compared to creating and connecting a socket as and when required ?
>>>>       
>>> I think it depends on the cost of making a connection.  It's often
>>> very small and once connected, there's no problem with your bandwidth.
>>>  If disconnection is unlikely, you could simply reconnect even if the
>>> connection cost is somewhat high.
>>>
>>> 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/Client-Connection-Pool-support-tf4722391s16868.html#a13602821
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: Client Connection Pool support

Posted by Brad Harvey <ha...@gmail.com>.
Hi Vishal,

If you're talking standard client side HTTP, MINA might not be the best 
tool for the job.  For example, see 
http://jakarta.apache.org/httpcomponents/httpclient-3.x/

One of the features you might be interested in:
* Connection management support for use in multi-threaded applications. 
Supports setting the maximum total connections as well as the maximum 
connections per host. Detects and closes stale connections.

Trustin mentioned that connection pools are useful when the cost of 
connection is relatively high (eg, SSL handshake).  Another time they 
are useful is when you want to limit the number of connections to the 
server from a multi threaded client.  This is often to conserve 
resources/limit load on the server.

Cheers,
Brad.

Vishal_Jain wrote:
> Thanks Trustin !
>
> The server i have at my disposal is within the LAN (same subnet) and the
> connection time i have noticed is about 50ms.
> My dilemma is to whether accept 50ms as acceptable/reasonable or try
> something to further reduce this.
> Purpose is to connect to a HTTP server (tomcat actually) and send/receive
> requests (socket would close after every transaction); my aim is to keep the
> system decently scalable with heavy loads (am not sure about how heavy it
> could get yet).
>
> - vishal
>
>
> Trustin Lee wrote:
>   
>> On 11/6/07, Vishal_Jain <pi...@gmail.com> wrote:
>>     
>>> Thats right.
>>> I was wondering if someone in this forum has implemented a connection
>>> pool
>>> (not necessarily around Mina) and perhaps share with rest of newbies like
>>> me
>>> ? :)
>>> Another doubt i have is regarding keeping a pool of 'connected' sockets.
>>> How
>>> useful is it to pull up a already connected socket and do a message
>>> exchange
>>> compared to creating and connecting a socket as and when required ?
>>>       
>> I think it depends on the cost of making a connection.  It's often
>> very small and once connected, there's no problem with your bandwidth.
>>  If disconnection is unlikely, you could simply reconnect even if the
>> connection cost is somewhat high.
>>
>> HTH,
>> Trustin
>> -- 
>> what we call human nature is actually human habit
>> --
>> http://gleamynode.net/
>> --
>> PGP Key ID: 0x0255ECA6
>>
>>
>>     
>
>   

Re: Client Connection Pool support

Posted by Vishal_Jain <pi...@gmail.com>.
Thanks again :)
i'll start tinkering with the server side a bit then ;)



Trustin Lee wrote:
> 
> Most modern HTTP servers support keep-alive and request pipelining, so
> connection cost shouldn't be a problem at all.  You can send millions
> of messages with one HTTP connection.
> 
> Trustin
> 
> On 11/6/07, Vishal_Jain <pi...@gmail.com> wrote:
>>
>> Thanks Trustin !
>>
>> The server i have at my disposal is within the LAN (same subnet) and the
>> connection time i have noticed is about 50ms.
>> My dilemma is to whether accept 50ms as acceptable/reasonable or try
>> something to further reduce this.
>> Purpose is to connect to a HTTP server (tomcat actually) and send/receive
>> requests (socket would close after every transaction); my aim is to keep
>> the
>> system decently scalable with heavy loads (am not sure about how heavy it
>> could get yet).
>>
>> - vishal
>>
>>
>> Trustin Lee wrote:
>> >
>> > On 11/6/07, Vishal_Jain <pi...@gmail.com> wrote:
>> >>
>> >> Thats right.
>> >> I was wondering if someone in this forum has implemented a connection
>> >> pool
>> >> (not necessarily around Mina) and perhaps share with rest of newbies
>> like
>> >> me
>> >> ? :)
>> >> Another doubt i have is regarding keeping a pool of 'connected'
>> sockets.
>> >> How
>> >> useful is it to pull up a already connected socket and do a message
>> >> exchange
>> >> compared to creating and connecting a socket as and when required ?
>> >
>> > I think it depends on the cost of making a connection.  It's often
>> > very small and once connected, there's no problem with your bandwidth.
>> >  If disconnection is unlikely, you could simply reconnect even if the
>> > connection cost is somewhat high.
>> >
>> > 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/Client-Connection-Pool-support-tf4722391s16868.html#a13600197
>> Sent from the Apache MINA Support Forum mailing list archive at
>> Nabble.com.
>>
>>
> 
> 
> -- 
> 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/Client-Connection-Pool-support-tf4722391s16868.html#a13600293
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: Client Connection Pool support

Posted by Trustin Lee <tr...@gmail.com>.
Most modern HTTP servers support keep-alive and request pipelining, so
connection cost shouldn't be a problem at all.  You can send millions
of messages with one HTTP connection.

Trustin

On 11/6/07, Vishal_Jain <pi...@gmail.com> wrote:
>
> Thanks Trustin !
>
> The server i have at my disposal is within the LAN (same subnet) and the
> connection time i have noticed is about 50ms.
> My dilemma is to whether accept 50ms as acceptable/reasonable or try
> something to further reduce this.
> Purpose is to connect to a HTTP server (tomcat actually) and send/receive
> requests (socket would close after every transaction); my aim is to keep the
> system decently scalable with heavy loads (am not sure about how heavy it
> could get yet).
>
> - vishal
>
>
> Trustin Lee wrote:
> >
> > On 11/6/07, Vishal_Jain <pi...@gmail.com> wrote:
> >>
> >> Thats right.
> >> I was wondering if someone in this forum has implemented a connection
> >> pool
> >> (not necessarily around Mina) and perhaps share with rest of newbies like
> >> me
> >> ? :)
> >> Another doubt i have is regarding keeping a pool of 'connected' sockets.
> >> How
> >> useful is it to pull up a already connected socket and do a message
> >> exchange
> >> compared to creating and connecting a socket as and when required ?
> >
> > I think it depends on the cost of making a connection.  It's often
> > very small and once connected, there's no problem with your bandwidth.
> >  If disconnection is unlikely, you could simply reconnect even if the
> > connection cost is somewhat high.
> >
> > 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/Client-Connection-Pool-support-tf4722391s16868.html#a13600197
> Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.
>
>


-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Re: Client Connection Pool support

Posted by Vishal_Jain <pi...@gmail.com>.
Thanks Trustin !

The server i have at my disposal is within the LAN (same subnet) and the
connection time i have noticed is about 50ms.
My dilemma is to whether accept 50ms as acceptable/reasonable or try
something to further reduce this.
Purpose is to connect to a HTTP server (tomcat actually) and send/receive
requests (socket would close after every transaction); my aim is to keep the
system decently scalable with heavy loads (am not sure about how heavy it
could get yet).

- vishal


Trustin Lee wrote:
> 
> On 11/6/07, Vishal_Jain <pi...@gmail.com> wrote:
>>
>> Thats right.
>> I was wondering if someone in this forum has implemented a connection
>> pool
>> (not necessarily around Mina) and perhaps share with rest of newbies like
>> me
>> ? :)
>> Another doubt i have is regarding keeping a pool of 'connected' sockets.
>> How
>> useful is it to pull up a already connected socket and do a message
>> exchange
>> compared to creating and connecting a socket as and when required ?
> 
> I think it depends on the cost of making a connection.  It's often
> very small and once connected, there's no problem with your bandwidth.
>  If disconnection is unlikely, you could simply reconnect even if the
> connection cost is somewhat high.
> 
> 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/Client-Connection-Pool-support-tf4722391s16868.html#a13600197
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: Client Connection Pool support

Posted by Trustin Lee <tr...@gmail.com>.
On 11/6/07, Vishal_Jain <pi...@gmail.com> wrote:
>
> Thats right.
> I was wondering if someone in this forum has implemented a connection pool
> (not necessarily around Mina) and perhaps share with rest of newbies like me
> ? :)
> Another doubt i have is regarding keeping a pool of 'connected' sockets. How
> useful is it to pull up a already connected socket and do a message exchange
> compared to creating and connecting a socket as and when required ?

I think it depends on the cost of making a connection.  It's often
very small and once connected, there's no problem with your bandwidth.
 If disconnection is unlikely, you could simply reconnect even if the
connection cost is somewhat high.

HTH,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Re: Client Connection Pool support

Posted by peter royal <pr...@apache.org>.
On Nov 5, 2007, at 10:03 PM, Vishal_Jain wrote:
> Thats right.
> I was wondering if someone in this forum has implemented a  
> connection pool
> (not necessarily around Mina) and perhaps share with rest of newbies  
> like me
> ? :)

I have implemented a custom connection pool for my purposes.. Wrapping  
an IoConnector as Trustin suggests.

Its somewhat specific to how I use MINA though, as I'm unable to  
preserve the full behavior of the IoSession when pooling is enabled. I  
can see about getting my company to allow it to be contributed, as it  
would be the basis for a generic pooling IoConnector..

-pete

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




Re: Client Connection Pool support

Posted by Vishal_Jain <pi...@gmail.com>.
Thats right.
I was wondering if someone in this forum has implemented a connection pool
(not necessarily around Mina) and perhaps share with rest of newbies like me
? :)
Another doubt i have is regarding keeping a pool of 'connected' sockets. How
useful is it to pull up a already connected socket and do a message exchange
compared to creating and connecting a socket as and when required ?

vishal


Trustin Lee wrote:
> 
> On 11/5/07, Vishal_Jain <pi...@gmail.com> wrote:
>>
>> Is there a way this can be implemented with existing features till we
>> wait
>> for version 2.0 ?
> 
> MINA is nothing but an abstract API.  You can implement a meta
> connector which wraps more than one connectors so the meta connector
> manages the connection.
> 
> 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/Client-Connection-Pool-support-tf4722391s16868.html#a13600064
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: Client Connection Pool support

Posted by Trustin Lee <tr...@gmail.com>.
On 11/5/07, Vishal_Jain <pi...@gmail.com> wrote:
>
> Is there a way this can be implemented with existing features till we wait
> for version 2.0 ?

MINA is nothing but an abstract API.  You can implement a meta
connector which wraps more than one connectors so the meta connector
manages the connection.

HTH,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Re: Client Connection Pool support

Posted by Vishal_Jain <pi...@gmail.com>.
Is there a way this can be implemented with existing features till we wait
for version 2.0 ? 

vishal


Trustin Lee wrote:
> 
> On 10/31/07, liquidchen <li...@gmail.com> wrote:
>>
>> Hi, does mina Connector provide any function can do like sokcet
>> connection
>> pool?? Thanks...
> 
> Not yet.  It should be added in 2.0 while implementing the
> auto-reconnection feature, because it belongs to what meta-transports
> are supposed to do.
> 
> 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/Client-Connection-Pool-support-tf4722391s16868.html#a13580415
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: Client Connection Pool support

Posted by Trustin Lee <tr...@gmail.com>.
On 10/31/07, liquidchen <li...@gmail.com> wrote:
>
> Hi, does mina Connector provide any function can do like sokcet connection
> pool?? Thanks...

Not yet.  It should be added in 2.0 while implementing the
auto-reconnection feature, because it belongs to what meta-transports
are supposed to do.

HTH,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6