Changeset 12061 for sample/pingpong
- Timestamp:
- Jun 19, 2013, 12:58:43 PM (11 years ago)
- Location:
- sample/pingpong
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sample/pingpong/PingPong.cpp
r12060 r12061 26 26 config_file(config) 27 27 { 28 Timer::setInterval( 3000 );28 Timer::setInterval( 5000 ); 29 29 } 30 30 … … 60 60 } 61 61 62 name = "TODO"; 62 // use node name also in the application 63 name = config.get("ariba.node_name", "NO_NAME"); 63 64 64 65 // bind communication and node listener … … 108 109 // this can be all nodes (OneHop) overlay or just some neighbors 109 110 // in case of a Chord or Kademlia structure 111 // NOTE: Currently ariba only supports the Chord overlay. 110 112 111 113 // in this sample we use auto-links: we just send out our message … … 114 116 // a link and start using the link in the CommunicationListener::onLinkUp 115 117 // function that is implemented further down in PingPong::onLinkUp 118 119 // NOTE: This example still uses the old deprecated ariba::message messages 120 // with the ariba built-in serialization. 121 // For future applications please use the new reboost::message_t messages. 122 // Data is stored in high efficient zero-copy buffers of type 123 // reboost::shared_buffer_t. These buffers hold plain data, so you have to 124 // serialize the data "on your own". 125 // We reccomend third-party serialization libraries like: 126 // - Protocol Buffers (http://en.wikipedia.org/wiki/Protocol_Buffers) 127 // - MessagePack (http://en.wikipedia.org/wiki/MessagePack) 116 128 117 129 pingId++; 118 // logging_info( endl << "#################" << endl119 130 logging_info( endl << "|||||||||| >>>>>>>>>>" << endl 120 131 << "[PINGPONG]\t PINGING overlay neighbors with ping id " << pingId ); … … 173 184 for (int i=0;i<names.size(); i++) if (names[i]==pingmsg->getName()) found=true; 174 185 if (!found) names.push_back(pingmsg->getName()); 175 // logging_info( endl << "#################" << endl176 186 logging_info( endl << "<<<<<<<<<< ||||||||||" << endl 177 187 << "[PINGPONG]\t RECEIVED ping message on link " -
sample/pingpong/main.cpp
r12060 r12061 13 13 if (argc >= 2) config = argv[1]; 14 14 15 // StartupWrapper::initConfig( config );16 15 StartupWrapper::startSystem(); 17 16
Note:
See TracChangeset
for help on using the changeset viewer.