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 | #include "ariba/utility/bootstrap/BootstrapManager.h"
|
---|
12 | using ariba::utility::BootstrapManager;
|
---|
13 |
|
---|
14 | void 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 |
|
---|
34 | int 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 | }
|
---|