Re: a question about how to use a common connection in Orbacus

Stan Lewis <[email protected]> Thu, 19 Oct 2006 10:55:46 -0400
Newsgroups gmane.comp.corba.orbacus
Organization IONA Technologies
Message-ID <[email protected]>
Hi Zhai,

On Tuesday 17 October 2006 10:02, Zhai wrote:
> Hi,
>   Now we have a question about how to use a common
> connection in Orbacus.
>   In detail, there are a client and a server program.
> First the client initializes an Orb and create a
> common connection to the server, then tens of  threads
> are created in the client and all of them use the only
> one connection to communicate to the server to get
> service by invoking its various methods. The question
> is that: int the above condition, would these threads
> use the connection securely and do not interfere with
> each other? if not, how to implement the above
> requirement.

Yes, your applications threads can share the same connection safely for the 
most part, however I'd be wary of using _OB_CloseConnection() in this case, 
as you can run into situations where one thread can close the connection 
while another thread is trying to send an invocation.

One thing to note is that you can also get these threads to use their own 
connection if you set the OB::CONNECTION_REUSE_POLICY_ID to false, then each 
thread will open it's own connection to the server.

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