Re: 回复: Re: [OB-Users] a question about how to use a common connection in Orbacus

Stan Lewis <[email protected]> Mon, 23 Oct 2006 09:38:17 -0400
Newsgroups gmane.comp.corba.orbacus
Organization IONA Technologies
Message-ID <[email protected]>
Hi Zhai,

On Sunday 22 October 2006 05:07, Zhai wrote:
> Hi,Stan
>   we want to know why the first
> connection(192.1.101.205:33189 to
>  192.1.101.202:11000) would not be closed before the
> second connection is created, and when would the first
> connection be closed, and how to close it? It seems it
> should be closed after the second connection was
> created.

If you set the OB::CONNECTION_REUSE_POLICY_ID policy to false, the ORB will 
create multiple connections in parallel to the target object for each proxy 
that's created.  You can close them by either explicitly calling:

proxy_object->_OB_closeConnection(true);

when you're done invoking or by setting a low idle timeout for client 
connections via the "ooc.orb.client_timeout" configuration variable (the idle 
time value is in seconds, 0 indicates no timeout).

If you set the OB::CONNECTION_REUSE_POLICY_ID policy to true, the ORB will 
only create one connection that's shared by all proxy instances.  If you're 
making invocations via multiple threads I'd recommend that you not explicitly 
close the connection, as you could possibly close the connection from one 
thread while another thread is in the process of making an invocation.  
However, you can still use the "ooc.orb.client_timeout" configuration 
variable to control when the client closes it's connection to the server, as 
it would be closed when all threads are done making invocation for some idle 
period.

Regards,

Stan
-- 
Stan Lewis                          
Team Orbacus - Your CORBA Source
E-Mail: [email protected]
WWW: http://www.orbacus.com
_______________________________________________
OB-Users Mailing List - [email protected]
http://mail.ooc.nf.ca/mailman/listinfo/ob-users
Visit our support FAQ before you send a message.
http://www.orbacus.com/faq/support.html