source: sample/pingpong/main.cpp@ 4950

Last change on this file since 4950 was 4925, checked in by huebsch, 15 years ago

-bootstrap und ablauf

File size: 1.2 KB
Line 
1#include <string>
2#include "ariba/utility/system/StartupWrapper.h"
3#include "PingPong.h"
4
5using std::string;
6using ariba::utility::StartupWrapper;
7using ariba::application::pingpong::PingPong;
8
9//*************************************************
10/*
11#include "ariba/utility/bootstrap/BootstrapManager.h"
12using ariba::utility::BootstrapManager;
13
14void debug(){
15 StartupWrapper::startSystem();
16
17 BootstrapManager& manager = BootstrapManager::instance();
18 manager.registerModule( BootstrapManager::BootstrapTypePeriodicBroadcast );
19
20 manager.publish("testname", "testinfo1", "testinfo2", "testinfo3");
21 getchar();
22 manager.revoke("testname");
23
24 manager.unregisterModule( BootstrapManager::BootstrapTypePeriodicBroadcast );
25 StartupWrapper::stopSystem();
26}
27*/
28//*************************************************
29
30int main( int argc, char** argv ) {
31
32 //debug();
33 //return 0;
34
35 // get config file
36 string config = "../etc/settings.cnf";
37 if (argc >= 2) config = argv[1];
38
39 StartupWrapper::initConfig( config );
40 StartupWrapper::startSystem();
41
42 // this will do the main functionality and block
43 PingPong ping;
44 StartupWrapper::startup(&ping);
45
46 // --> we will run blocking until <enter> is hit
47
48 StartupWrapper::shutdown(&ping);
49 StartupWrapper::stopSystem();
50
51 return 0;
52}
Note: See TracBrowser for help on using the repository browser.