[omniORB] Newbie: multiple connections multiple sites

Luke Deller ldeller at xplantechnology.com
Tue Jan 10 11:38:35 GMT 2006


Hi Neil,

On Mon, 2006-01-09 at 21:15 +0000, Neil Vince wrote:
> I've two servers,  both with a client and server app, now the clients
> on each machine need to be able to talk two both server apps (on each
> servers) in parallel.  My problem is I don't know how to obtain object
> references for them.   On one machine no problem, but across two
> difference hosts I'm struggling.

Let me list the different ways you can get an object reference:
     1. By calling an operation on a CORBA object which returns an
        object reference (eg calling the naming service).  This is the
        way most object references are obtained, but obviously doesn't
        work for your first object reference.
     2. By calling the operation "string_to_object" of the ORB.  This
        operation takes a string argument which can be in the following
        forms:
              * "IOR:<big_long_hex_string>" as returned by
                "object_to_string"
              * "corbaloc:..." URL (details in CORBA spec section
                13.6.10).  "corbaloc:iiop:..." is only useful if you
                know the object key and listening POA port, which
                usually only applies to bootstrap objects like the
                naming service.
              * "corbaname:" URL (details in CORBA spec section
                13.6.10.5).  This one is a shortcut for looking up a
                path in a naming service.  If no path is specified, it
                just gives you the naming service itself.
     3. By calling the operation "resolve_initial_references" of the
        ORB.  This is like "string_to_object", except the string is
        looked up by name in your ORB configuration rather than being
        supplied directly (see omniORB's config parameter called
        "InitRef").

> Can I talk to two naming services at once?

Yes.  For example, to get an object reference to one of them you could
use the string "corbaloc:iiop:yournshostname:2809/NameService" or
equivalently "corbaname::yournshostname".  You can just pass this string
to orb.string_to_object(..) to get the object reference.

You could also use a single shared naming service, if you don't mind the
latency of contacting a naming service across the network.

> Can I just use the 'corbaloc' naming mechanism to get object refs?

I'd suggest that you only use this for your name service, because you
won't know the object key or POA port of your other objects.  Look up
your other object references in the name service.

Regards,
Luke.

**********************************************************************************************

Important Note
This email (including any attachments) contains information which is
confidential and may be subject to legal privilege.  If you are not
the intended recipient you must not use, distribute or copy this
email.  If you have received this email in error please notify the
sender immediately and delete this email. Any views expressed in this
email are not necessarily the views of XPlan Technology.

It is the duty of the recipient to virus scan and otherwise test the
information provided before loading onto any computer system.
Xplan Technology does not warrant that the
information is free of a virus or any other defect or error.
**********************************************************************************************




More information about the omniORB-list mailing list