Hi,
I see in the demo examples of ssl, sl3 the client uses the IOR file to bind
with the server object . Is it mandatory to use the IOR file itself when
we are using SSL/TLS ? Can the client connect with corbaloc uri?
I was trying to achieve this with Corbaloc on my application , but I am
getting IDL:omg.org/CORBA/TRANSIENT:1.0 (0, maybe-completed) exception.
server.cc:
class HelloWorld_impl : virtual public POA_HelloWorld
{
public:
virtual void hello ( const char* msg);
};
void
HelloWorld_impl::hello(const char* msg)
{
cout<<"Hello world for client = " << msg <<endl;
}
int main (int argc, char *argv[])
{
CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
CORBA::Object_var poaobj = orb->resolve_initial_references ("RootPOA");
PortableServer::POA_var poa = PortableServer::POA::_narrow (poaobj);
PortableServer::POAManager_var mgr = poa->the_POAManager();
CORBA::PolicyList pl1;
pl1.length (3);
pl1[0] = poa->create_lifespan_policy (PortableServer::PERSISTENT);
pl1[1] = poa->create_id_assignment_policy (PortableServer::USER_ID);
pl1[2] = poa->create_thread_policy (PortableServer::SINGLE_THREAD_MODEL);
PortableServer::POA_var ser_poa = poa->create_POA ("SerPOA",
PortableServer::POAManager::_nil (), pl1);
PortableServer::POAManager_var ser_mgr = ser_poa->the_POAManager ();
HelloWorld_impl * hello = new HelloWorld_impl;
PortableServer::ObjectId_var oid = PortableServer::string_to_ObjectId(
"hello" );
ser_poa -> activate_object_with_id( oid.in(), hello );
ofstream of ("hello.ref");
CORBA::Object_var ref = ser_poa->id_to_reference (oid.in());
CORBA::String_var str = orb->object_to_string (ref.in());
of << str.in() << endl;
of.close ();
mgr->activate ();
ser_mgr->activate ();
orb->run();
poa->destroy (TRUE, TRUE);
delete hello;
return 0;
}
client.cc
int
main (int argc, char *argv[])
{
CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
timeval a, c, d;
timeval b;
char uri[300];
sprintf (uri, "corbaloc::%s:%s/server/SerPOA/hello", argv[1], argv[2]);
cout << "uri:" << uri << endl;
try
{
CORBA::Object_var obj = orb->string_to_object (uri);
if (!CORBA::is_nil(obj))
{
HelloWorld_var hello = HelloWorld::_narrow (obj);
string msg= "HI";
hello->hello(msg.c_str());
}
}
catch (CORBA::Exception &ex) {
cout<<"Error calling method hello : " << ex <<endl;
}
return 0;
}
I run the server as :
./server -ORBIIOPAddr ssl:inet:`uname -n`:12124 -ORBDebug Warning
-ORBSSLcert s_cert.pem -ORBSSLkey s_key.pem -POAImplName server
client as :
./client $host 12124 -ORBDebug Warning -ORBSSLcert c_cert.pem -ORBSSLkey
c_key.pem
what am i missing here.
Thanks and Regards,
Ganga
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mico-devel mailing list
Mico-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mico-devel