Changes between Version 8 and Version 9 of Documentation/Tutorial/PingPong


Ignore:
Timestamp:
Jan 21, 2009, 8:48:45 AM (15 years ago)
Author:
huebsch
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/Tutorial/PingPong

    v8 v9  
    4747
    4848
    49 Now we look into the ''PingPong.cpp'', containing the actual ping pong code. We leave out .h files here because they only do definitions. Everyone intending to use ''Ariba'' should be familiar with the subject matter.
     49Now we look into the ''PingPong.cpp'', containing the actual ping pong code. We leave out .h files here because they only do definitions. Everyone intending to use ''Ariba'' should be familiar with the subject matter. The first parts look like this:
     50
     51{{{
     5201 #include "PingPong.h"
     5302
     5403 namespace ariba {
     5504 namespace application {
     5605 namespace pingpong {
     5706
     5807 use_logging_cpp(PingPong);
     5908 ServiceID PingPong::PINGPONG_ID = ServiceID(111);
     6009
     6110 PingPong::PingPong() : pingid( 0 ) {
     6211 }
     6312
     6413 PingPong::~PingPong(){
     6514 }
     6615
     6716 void PingPong::setMode(bool startingNode){
     6817      startping = startingNode;
     6918 }
     7019
     7120 void PingPong::startup(UnderlayAbstraction* _abstraction){
     7221      abstraction = _abstraction;
     7322
     7423      logging_info( "starting up PingPong service ... " );
     7524
     7625      SpoVNetID spovnetid (Identifier(5000));
     7726
     7827      NodeID nodeid = (Configuration::instance().exists("BASE_nodeid") ?
     7928                      NodeID(Identifier(Configuration::instance().read<unsigned long>("BASE_nodeid"))) :
     8029                      NodeID::UNSPECIFIED);
     8130
     8231      IPv4Locator* locallocator = (Configuration::instance().exists("BASE_localLocator") ?
     8332                                      &(IPv4Locator::fromString(Configuration::instance().read<string>("BASE_localLocator"))) :
     8433                                      NULL);
     8534
     8635      uint16_t localport = Configuration::instance().exists("BASE_port") ?
     8736                              Configuration::instance().read<uint16_t>("BASE_port") :
     8837                              ARIBA_DEFAULT_PORT;
     8938
     9039      if( !startping )
     9140              context = abstraction->createSpoVNet( spovnetid, nodeid, locallocator, localport );
     9241      else
     9342              context = abstraction->joinSpoVNet  ( spovnetid, nodeid, locallocator, localport );
     9443
     9544      overlay = &context->getOverlay();
     9645      overlay->bind( this, PingPong::PINGPONG_ID );
     9746
     9847      logging_info( "PingPong started up" );
     9948
     10049      // trigger the creation of the pathload measurement module
     10150      //PathloadMeasurement::instance( overlay );
     10251 }
     103}}}
    50104
    51105
     106