Changeset 12062


Ignore:
Timestamp:
Jun 19, 2013, 1:00:15 PM (12 years ago)
Author:
hock@…
Message:

..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sample/pingpong/PingPong.cpp

    r12061 r12062  
    9898
    9999// 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
     100void PingPong::eventFunction()
     101{
     102        // We ping all nodes that are known in the overlay structure
    109103        // this can be all nodes (OneHop) overlay or just some neighbors
    110104        // in case of a Chord or Kademlia structure
    111105        // NOTE: Currently ariba only supports the Chord overlay.
    112106
    113         // in this sample we use auto-links: we just send out our message
     107        // In this sample we use auto-links: we just send out our message
    114108        // to the node and the link is established automatically. for more
    115109        // control we would use the node->establishLink function to create
     
    123117        //   reboost::shared_buffer_t. These buffers hold plain data, so you have to
    124118        //   serialize the data "on your own".
    125         // We reccomend third-party serialization libraries like:
     119        // We recommend third-party serialization libraries like:
    126120        //   - Protocol Buffers (http://en.wikipedia.org/wiki/Protocol_Buffers)
    127121        //   - MessagePack      (http://en.wikipedia.org/wiki/MessagePack)
    128122
     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   
    129132        pingId++;
    130133    logging_info( endl << "|||||||||| >>>>>>>>>>" << endl
Note: See TracChangeset for help on using the changeset viewer.