Changes between Version 24 and Version 25 of Documentation/Tutorial/PingPong
- Timestamp:
- Apr 28, 2009, 3:43:57 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Documentation/Tutorial/PingPong
v24 v25 6 6 To help getting into using Ariba, we provide a short example of how to use the architecture. For this, assume a simple service whose only intention is to exchange data packets between two participating nodes, just like playing ping pong. You will find the whole code within the package under ''sample/pingpong''. 7 7 8 The source files divide into the main code (''!PingPong.h/.cpp'') and the used message format (declared in ''!PingPongMessage.h/.cpp''). In Addition, ''main.cpp'' acts as the entry point to the ping-pong example. We will first give a high-level introduction about what the example does and later dig deeper into the code.8 The source files divide into the main code (''!PingPong.h/.cpp'') and the used message format (declared in ''!PingPongMessage.h/.cpp''). In addition, ''main.cpp'' acts as the entry point to the ping-pong example. We will first give a high-level introduction about what the example does and later dig deeper into the code. 9 9 10 10 '''What it does''' 11 11 12 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, 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.12 As already mentioned, the example service simply exchanges packets between 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 some nodes have successfully joined the instance, they starts sending packets to each other periodically. This happens until a button is pressed. 13 13 14 14 '''How it does it'''