source: sample/pingpong/main.cpp@ 4924

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

-bootstrap und ablauf

File size: 1.3 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 std::cout << "yyyyyyyyy!" << std::endl;
18
19 BootstrapManager& manager = BootstrapManager::instance();
20 manager.registerModule( BootstrapManager::BootstrapTypePeriodicBroadcast );
21
22 std::cout << "xxxxxxxxxxxxyyyyyyyyy!" << std::endl;
23
24 manager.publish("testname", "testinfo1", "testinfo2", "testinfo3");
25 getchar();
26 manager.revoke("testname");
27
28 manager.unregisterModule( BootstrapManager::BootstrapTypePeriodicBroadcast );
29 StartupWrapper::stopSystem();
30}
31
32//*************************************************
33
34int main( int argc, char** argv ) {
35
36 debug();
37 return 0;
38
39
40 // get config file
41 string config = "../etc/settings.cnf";
42 if (argc >= 2) config = argv[1];
43
44 StartupWrapper::initConfig( config );
45 StartupWrapper::startSystem();
46
47 // this will do the main functionality and block
48 PingPong ping;
49 StartupWrapper::startup(&ping);
50
51 // --> we will run blocking until <enter> is hit
52
53 StartupWrapper::shutdown(&ping);
54 StartupWrapper::stopSystem();
55
56 return 0;
57}
Note: See TracBrowser for help on using the repository browser.