I'm new to Corba (and Mico) and could sure use a little help ....
I'm writing a Corba client using Mico 2.3.12 which will talk to an Orbix
6.x server. First, can anyone verify that this should work?
The first thing I need to do is connect to the Orbix naming service and
I'm getting a segfault. I'm probably not doing something right. My call
to "orb->resolve_initial_references ("NameService")" returns without
error, but when I call "CosNaming::NamingContext::_narrow (nsobj)" on
the name service object, I get a segfault. I call my code thus:
./get-orbix-name-service -ORBInitRef
NameService=corbaloc::10.77.83.35:3075/NameService
My sample code is given below. Any help would be hugely appreciated.
Thanks,
Chuck
--------------get-orbix-name-service--------------------
#include <CORBA.h>
#include <coss/CosNaming.h>
using namespace std;
int main (int argc, char *argv[])
{
// ORB initialization
CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, "mico-local-orb" );
CORBA::Object_var nsobj =
orb->resolve_initial_references ("NameService");
if (CORBA::is_nil(nsobj)) {
cerr << "oops, name service is nil" << endl;
exit(1);
}
CosNaming::NamingContext_var nc =
CosNaming::NamingContext::_narrow (nsobj);
if (CORBA::is_nil (nc)) {
cerr << "oops, I cannot access the Naming Service!" << endl;
exit (1);
}
cout << "acquired naming service" << endl;
return 0;
}
-------------------------------------------------------------
_______________________________________________
Mico-devel mailing list
[email protected]
http://www.mico.org/mailman/listinfo/mico-devel