Beispiel #1
0
int
ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
  ACE_LOG_MSG->priority_mask(LM_TRACE     |
                             LM_DEBUG     |
                             LM_INFO      |
                             LM_NOTICE    |
                             LM_WARNING   |
                             LM_ERROR     |
                             LM_CRITICAL  |
                             LM_ALERT     |
                             LM_EMERGENCY,
                             ACE_Log_Msg::PROCESS);


  ClientApp app;

  try
  {
    int ret = app.run(argc,argv);
    return ret == 1 ? 0 : ret;
  }
  catch (const CORBA::Exception& ex)
  {
     ex._tao_print_exception ("Caught exception:");
  }
  catch (...)
  {
    ACE_ERROR((LM_ERROR,
               "(%P|%t) Unknown (...) exception caught in main() "
               "for ClientApp\n"));
  }

  return 1;
}
Beispiel #2
0
int main(int argc, char **argv) {
	ClientApp app;
	NGetOpt<ClientApp> opts(argc, argv, &app, 1);
	
	setup_opts(&opts);
	
	try {
		if (opts.proccess()) {
			app.run();
		}
	}
	catch (NException &e) {
		NWarning::print() << "Error: " << e.getDescription();
		exit(1);
	}
	
	return 0;
}