//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project / testing
//
//File: server.cpp
//
//Version: $Revision: 1.5 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/12/16 14:09:13 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications Software and Multimedia
//
//Author: Timo Pärnänen
//
//
//Description:
//
//
//Copyright:
//
//
//Licence:
//
//
//History: 

#include <typeinfo>
#include <iostream.h>
#include <string>

#include "pf/debug.h"
#include "pf/system.h"
#include "pf/naming.h"

#include "ORBacustest_impl.h"

//
//Function: main
//

int main(int argc, char *argv[])
{
    if (argc != 4)
    {
        cout << "\nUSAGE: " << argv[0] << "<interface> -ORBnaming `cat /PATH/FILE.ior`" << endl;
        cout << "e.g. " << argv[0] << " s1 -ORBnaming `cat /projects/IORs/Naming.ior`\n" 
             << endl;
        exit(0);
    }
    pfSystem::init(argc, argv);
    ORBacustestImpl *testImpl = new ORBacustestImpl();

    string nameString = "ORBacustest/";
    nameString += argv[1];

    CosNaming_Name name =
	pfNaming::instance()->parseName(nameString);
    try
    {
        pfNaming::instance()->bind(name, testImpl);
    }
    catch (...)
    {
        debugUser("bind to nameservice failed");
    }
    pfSystem::instance()->run();
    return 0;
}
