<html><body bgcolor="#ffffff">Hi, all,<br><br>I guess its quite a newbie's question but can not find any answer from google.<br>I am now trying to implement Interoperable Naming Service (INS) using C++ (omniORB).<br>I have already implemented it using Java (Java IDL).<br><br>
Now I have a question, how could I tell the orb which port the servant should be listening on so the client could use: <br>client -ORBInitRef PingService=corbaloc:iiop:1.2@host:port/serviceId to find it.<br><br>I now assume it would use the default port 2809. Then the server side code is:<br><br style="font-style: italic;"><span style="font-style: italic;">CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);</span><br style="font-style: italic;"><span style="font-style: italic;"> CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");</span><br style="font-style: italic;"><span style="font-style: italic;">PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);</span><br style="font-style: italic;"><span style="font-style: italic;"> INSServer* servant = new INSServer();</span><br style="font-style: italic;"><span style="font-style: italic;">PortableServer::ObjectId_var obj_var = poa->activate_object(servant);</span><br style="font-style: italic;"><span style="font-style: italic;">Service_var serviceRef = server->_this();</span><br style="font-style: italic;"><span style="font-style: italic;">servant->_remove_ref();</span><br style="font-style: italic;"><span style="font-style: italic;">PortableServer::POAManager_var pman = poa->the_POAManager();</span><br style="font-style: italic;"><span style="font-style: italic;">pman->activate();</span><br style="font-style: italic;"><span style="font-style: italic;">orb->register_initial_reference("PingService", serviceRef);</span><br style="font-style: italic;"><span style="font-style: italic;"> orb->run();</span><br><br>However, when the client starts with<br><span style="font-style: italic;">client -ORBInitRef PingService=corbaloc:iiop:1.2@host:2809/PingService</span><br>it reports OBJECT_NOT_EXIST<br><br>Any thing I did wrong?<br><br>Cheers<br><br>Luke<br></body></html>