Changes between Version 15 and Version 16 of Documentation/Tutorial/PingPong


Ignore:
Timestamp:
Jan 22, 2009, 8:46:45 PM (15 years ago)
Author:
huebsch
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/Tutorial/PingPong

    v15 v16  
    99
    1010'''What it does'''
    11 As already mentioned, the example service simply exchanges packets between two participating network nodes. This is accomplished by using the ''Ariba'' abstraction to create a communication context and hide underlay details. The participants form a ''SpoVNet'' instance in which the first one (as the initiator) creates the instance, while the second joins. As soon as the second has successfully joined the instance, it starts sending packets to the initiator periodically. When such a packet reaches the latter, he responds by also sending a packet back. This procedure repeats, until a button is pressed.
     11
     12As already mentioned, the example service simply exchanges packets between two participating network nodes. This is accomplished by using the ''Ariba'' abstraction to create a communication context and hide underlay details. The participants form a ''SpoVNet'' instance in which the first one (as the initiator) creates the instance, while the second joins. As soon as the second has successfully joined the instance, the initiator starts sending packets to the it periodically. When such a packet reaches the latter, he responds by also sending a packet back. This procedure repeats, until a button is pressed.
    1213
    1314'''How it does it'''
     15
    1416Let's take a look at the code now. Writing a service is pretty simple when using ''Ariba'' because most difficulties and annoyances that could come up when struggling with writing network code are taken from the developer. We start with the ''main.cpp''.
    1517
     
    717320 void PingPong::startup(UnderlayAbstraction* _abstraction){
    727421      abstraction = _abstraction;
     75
     76
    737722
    747823      logging_info( "starting up PingPong service ... " );