[omniORB] How to connect to different Naming services in one corba object?

zhang ji zsfunl at yahoo.com
Fri Jun 6 09:31:50 BST 2003


Hi,

One of my CORBA object, L1, needs to connect to the
local nameservice to get the reference of one local
CORBA object L2 and another remote nameservice for
another remote CORBA object R1. In the local machine,
the omniorb config file set the nameservice as the
localhost; so in the L1' code, I re-initial the orb
with new remote nameservice corbaname as below:
//
CORBA::ORB_ptr ReInitORB(char* host, char* port){
        int a = 0;
        char* parameter[2][2];
        CORBA::ORB_ptr orb = NULL;
                                                      
        if (host && port) {
                parameter[0][0] = strdup("InitRef");
                parameter[0][1] = new char[256];
                sprintf(parameter[0][1],
"NameService=corbaname::%s:%s", host, port);
                parameter[1][0] = strdup("0");
                parameter[1][1] = strdup("0");
                orb = CORBA::ORB_init((int &)a,
(char**) NULL, "omniORB4", (const char*
(*)[2])parameter);
        } else
                orb = CORBA::ORB_init((int &)a,
(char**) NULL);
        return orb;
}
//

However, it does not work. So my question is how to
change the orb configure when I want to set it with
another new nameservice in remote host.

Thanks,
shifeng

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com



More information about the omniORB-list mailing list