Changeset 12061


Ignore:
Timestamp:
Jun 19, 2013, 12:58:43 PM (11 years ago)
Author:
hock@…
Message:

PingPong: some clean up

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • etc/pingpong/settings_node1.cnf

    r12060 r12061  
    1 
    21//JSON
    32{
    43    "ariba": {
     4        "node_name": "Node1",
    55        "spovnet_name": "pingpong",
    66       
     
    2121}
    2222
    23 
    24 
    25 //node.name = nodeone
    26 //ariba.endpoints = JSON { "endpoint_set": [ {"category": "TCPIP", "addr": "::", "port": 5003 } ] }
    27 //ariba.bootstrap.hints=pingpong{broadcast;mdns;}
    28 
    29 //pingpong.name = nodeone
    30 
  • sample/pingpong/PingPong.cpp

    r12060 r12061  
    2626        config_file(config)
    2727{
    28         Timer::setInterval( 3000 );
     28        Timer::setInterval( 5000 );
    2929}
    3030
     
    6060    }
    6161   
    62     name = "TODO";
     62    // use node name also in the application
     63    name = config.get("ariba.node_name", "NO_NAME");
    6364   
    6465        // bind communication and node listener
     
    108109        // this can be all nodes (OneHop) overlay or just some neighbors
    109110        // in case of a Chord or Kademlia structure
     111        // NOTE: Currently ariba only supports the Chord overlay.
    110112
    111113        // in this sample we use auto-links: we just send out our message
     
    114116        // a link and start using the link in the CommunicationListener::onLinkUp
    115117        // 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)
    116128
    117129        pingId++;
    118 //      logging_info( endl << "#################" << endl
    119130    logging_info( endl << "|||||||||| >>>>>>>>>>" << endl
    120131                << "[PINGPONG]\t PINGING overlay neighbors with ping id " << pingId );
     
    173184        for (int i=0;i<names.size(); i++) if (names[i]==pingmsg->getName()) found=true;
    174185        if (!found) names.push_back(pingmsg->getName());
    175 //      logging_info( endl << "#################" << endl
    176186        logging_info( endl << "<<<<<<<<<< ||||||||||" << endl
    177187                << "[PINGPONG]\t RECEIVED ping message on link "
  • sample/pingpong/main.cpp

    r12060 r12061  
    1313        if (argc >= 2) config = argv[1];
    1414
    15 //      StartupWrapper::initConfig( config );
    1615        StartupWrapper::startSystem();
    1716
Note: See TracChangeset for help on using the changeset viewer.