MICO

server.cc

#include <iostream.h>
#include <fstream.h>
#include <unistd.h>
#include "account.h"

class Account_impl : virtual public Account_skel {
  
  //as before.....
  
};

int main( int argc, char *argv[] )
{
    cout << "server init" << endl;

    AccountLoader loader;
    CORBA::ORB_var orb = CORBA::ORB_init( argc, argv, "mico-local-orb" );
    CORBA::BOA_var boa = orb->BOA_init (argc, argv, "mico-local-boa");

    Account_impl* server = new Account_impl;

    CORBA::String_var  ref= orb->object_to_string(server);
    ofstream out("/tmp/account.objid");
    out << ref << endl;
    out.close();

    boa->impl_is_ready(CORBA::ImplementationDef::_nil());
    orb->run();
    CORBA::release(server);

    return 0;
}

José M. Vidal .

7 of 8