- Timestamp:
- Jun 19, 2013, 1:00:15 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sample/pingpong/PingPong.cpp
r12061 r12062 98 98 99 99 // timer event 100 void PingPong::eventFunction() { 101 102 if ( node.getNeighborNodes().size() == 0) 103 { 104 logging_info( "[PINGPONG]\t +++ no neighbors +++" ); 105 return; 106 } 107 108 // we ping all nodes that are known in the overlay structure 100 void PingPong::eventFunction() 101 { 102 // We ping all nodes that are known in the overlay structure 109 103 // this can be all nodes (OneHop) overlay or just some neighbors 110 104 // in case of a Chord or Kademlia structure 111 105 // NOTE: Currently ariba only supports the Chord overlay. 112 106 113 // in this sample we use auto-links: we just send out our message107 // In this sample we use auto-links: we just send out our message 114 108 // to the node and the link is established automatically. for more 115 109 // control we would use the node->establishLink function to create … … 123 117 // reboost::shared_buffer_t. These buffers hold plain data, so you have to 124 118 // serialize the data "on your own". 125 // We rec comend third-party serialization libraries like:119 // We recommend third-party serialization libraries like: 126 120 // - Protocol Buffers (http://en.wikipedia.org/wiki/Protocol_Buffers) 127 121 // - MessagePack (http://en.wikipedia.org/wiki/MessagePack) 128 122 123 124 // don't do anything if we have no neighbors 125 if ( node.getNeighborNodes().size() == 0) 126 { 127 logging_info( "[PINGPONG]\t +++ no neighbors +++" ); 128 return; 129 } 130 131 129 132 pingId++; 130 133 logging_info( endl << "|||||||||| >>>>>>>>>>" << endl
Note:
See TracChangeset
for help on using the changeset viewer.