DemoServer.cpp 947 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #include "DemoServer.h"
  2. #include "DemoServantImp.h"
  3. using namespace std;
  4. DemoServer g_app;
  5. /////////////////////////////////////////////////////////////////
  6. void
  7. DemoServer::initialize()
  8. {
  9. //initialize application here:
  10. //...
  11. addServant<DemoServantImp>(ServerConfig::Application + "." + ServerConfig::ServerName + ".DemoServantObj");
  12. }
  13. /////////////////////////////////////////////////////////////////
  14. void
  15. DemoServer::destroyApp()
  16. {
  17. //destroy application here:
  18. //...
  19. }
  20. /////////////////////////////////////////////////////////////////
  21. int
  22. main(int argc, char* argv[])
  23. {
  24. try
  25. {
  26. g_app.main(argc, argv);
  27. g_app.waitForShutdown();
  28. }
  29. catch (std::exception& e)
  30. {
  31. cerr << "std::exception:" << e.what() << std::endl;
  32. }
  33. catch (...)
  34. {
  35. cerr << "unknown exception." << std::endl;
  36. }
  37. return -1;
  38. }
  39. /////////////////////////////////////////////////////////////////