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