[omniORB] newbie's question about register_initial_reference()

Luke luke.snow at diskstream.net
Thu May 18 15:11:30 BST 2006


Hi, all,

I guess its quite a newbie's question but can not find any answer from google.
I am now trying to implement Interoperable Naming Service (INS) using C++ (omniORB).
I have already implemented it using Java (Java IDL).

Now I have a question, how could I tell the orb which port the servant should be listening on so the client could use: 
client -ORBInitRef PingService=corbaloc:iiop:1.2 at host:port/serviceId to find it.

I now assume it would use the default port 2809. Then the server side code is:

CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
 CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
 INSServer* servant = new INSServer();
PortableServer::ObjectId_var obj_var = poa->activate_object(servant);
Service_var serviceRef = server->_this();
servant->_remove_ref();
PortableServer::POAManager_var pman = poa->the_POAManager();
pman->activate();
orb->register_initial_reference("PingService", serviceRef);
 orb->run();

However, when the client starts with
client -ORBInitRef PingService=corbaloc:iiop:1.2 at host:2809/PingService
it reports OBJECT_NOT_EXIST

Any thing I did wrong?

Cheers

Luke

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20060518/a3348a26/attachment.htm


More information about the omniORB-list mailing list