557

Corba - vreau port stabilit :)

############### trigon.idl ####################################ifndef __trigon_idl___#define __trigon_idl___interface Trigon { double sinus(in double arg); double cosinus(in double arg);};#endif################ mytest.cc ################################################ 1 #include 2 #include 3 #include 4 #include "trigon.hh" 5 6 class Trigon_Impl : public POA_Trigon, public PortableServer::RefCountServantBase { 7 virtual CORBA::Double sinus(CORBA::Double arg) { 8 return sin(arg); 9 } 10 11 virtual CORBA::Double cosinus(CORBA::Double arg) { 12 return cos(arg); 13 } 14 }; 15 16 int main(int argc, char *argv[]) { 17 CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); 18 CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); 19 PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); 20 21 Trigon_Impl *trigon = new Trigon_Impl(); 22 23 PortableServer::ObjectId_var trigonid = poa->activate_object(trigon); 24 obj = trigon->_this(); 25 CORBA::String_var sior(orb->object_to_string(obj)); 26 std::cerr _remove_ref(); 29 PortableServer::POAManager_var pman = poa->the_POAManager(); 30 pman->activate(); 31 32 orb->run(); 33 orb->destroy(); 34 35 return 0; 36 } 37-------------dupa compilare:./mytest'IOR:010000000f00000049444c3a547269676f6e3a312e300000010000000000000068000000010102000f0000003139322e3136382e39372e31383200001e0500000e000000fe318ac24300002c8d000000000000000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100'Pe alta masina pornesc un corba script, care imi intoarce corect rezultul.Problema consta in faptul ca la fiecare compilare+pornire obtin IOR nou. Si treb de-i facut paste in script.Stiu ca este lume care stie omnicorba pe aici:)Va rog sa ma ajutati!P.S.Listingul este cu line-numbers.
0