Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

start POA server with OAD in VisiBroker 4.5

Status
Not open for further replies.

Ilko

Programmer
Jul 2, 2003
1
BG
How I can start POA server with OAD in VisiBroker 4.5
How I resgistreit (give me example).

This is my Server:

main(int argc, char* argv[])
{
try
{
// Initialize the ORB and BOA
CORBA::ORB_var orb = CORBA::ORB_init(argc,argv);
CORBA::Object_var objRes=orb-> resolve_initial_references("RootPOA");
PortableServer::pOA_var rootPOA=PortableServer::pOA::_narrow(objRes);

PortableServer::pOAManager_var poaManager=rootPOA->the_POAManager();
CORBA::policyList policyList;
policyList.length(1);

policyList[0]=rootPOA->create_lifespan_policy(PortableServer::pERSISTENT);
PortableServer::pOA_var myPOA=rootPOA->create_POA("hayde",poaManager,policyList);

PortableServer::ObjectId_var objId=PortableServer::string_to_ObjectId("HaydeObject");
HaydeImpl *servant=new HaydeImpl;
myPOA->activate_object_with_id(objId,servant);
poaManager->activate();


orb->run();

}
catch(const CORBA::Exception& e)
{
Cerr << e << endl;
return(1);
}
return 0;
}
//---------------------------------------------------------------------------

This is my Client:

CORBA::ORB_var orb=CORBA::ORB_init();
PortableServer::ObjectId_var objId=PortableServer::string_to_ObjectId(&quot;HaydeObject&quot;);
Hayde_var pobj=Hayde::_bind(&quot;/hayde&quot;,objId);
pobj->fun();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top