Changes between Version 27 and Version 28 of Documentation/Tutorial/PingPong


Ignore:
Timestamp:
Apr 28, 2009, 4:01:43 PM (15 years ago)
Author:
huebsch
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/Tutorial/PingPong

    v27 v28  
    133133}}}
    134134
    135 First we include the .h file, define the namespace, turn logging functionality on (line 07) and set the ID of the Service. Every service using ''Ariba'' is connected to a specific ID that may be chosen initially and arbitrarily. This ID serves ''Ariba'' to distinguish between several services that may use it concurrently. Via ''setMode'' (lines 16-18) one can indicate which node in the example should start the packet sending process. This method is called in main.cpp after getting the specific information from the config file.
    136 
    137 The ''startup'' method (lines 20-51) is called from the !StartupWrapper, jolting the operation of the ping pong service. With its call, the !StartupWrapper passes an ''!UnderlayAbstraction'' object to the service, being the main object for communication between the service and ''Ariba'' (lines 20/21).
    138 When starting up, the service chooses a servcie ID (line 25). Then, it creates a node ID for the SpoVNet node it represents in the instance, under usage of potential base information deposited in the config file (lines 27-29). Same applies to its locator (lines 31-33) and the port (lines 35-37). Then we get to the point where we decide the role of the specific ping pong instance (initiator versus joiner) (lines 39-42). Remember that we got this information in line 17. If the starting node is the initiator of the SpoVNet instance, it creates the SpoVNet, specifying its SpoVNetID, NodeID, Locator and Port (line 40). In contrast, other nodes join the instance, providing the same parameters (line 42). After starting up, a service needs to bind to the SpoVNet Base Overlay with its service ID (lines 44/45). Finally, we may give out all kinds of logging infos by calling the method logging_info (line 47).
     135First we include the .h file, define the namespace, turn logging functionality on (line 12) and set the ID of the Service. Every service using ''Ariba'' is connected to a specific ID that may be chosen initially and arbitrarily. This ID serves ''Ariba'' to distinguish between several services that may use it concurrently.
     136
     137After definitions for construction und destruction (the first also setting a timer to 5 seconds), we come to the ''startup'' method.
     138The ''startup'' method (lines 20 ff.) is called from the !StartupWrapper, jolting the operation of the ping pong service. Here, we first create an AribaModule object, serving as our port to ''Ariba'' (line 33). Then, we give our network instance a specific name (being ''spovnet'' in the example), before we collect some configurational parameters (lines 46-56). Those parameters are defined in the config file, they serve e.g. in giving IP adresses and port numbers to ariba instances.
     139
     140Then we get to the point where we decide the role of the specific ping pong instance (initiator versus joiner) (lines 39-42). Remember that we got this information in line 17. If the starting node is the initiator of the SpoVNet instance, it creates the SpoVNet, specifying its SpoVNetID, NodeID, Locator and Port (line 40). In contrast, other nodes join the instance, providing the same parameters (line 42). After starting up, a service needs to bind to the SpoVNet Base Overlay with its service ID (lines 44/45). Finally, we may give out all kinds of logging infos by calling the method logging_info (line 47).
    139141 
    140142