| 161 | {{{ |
| 162 | 110 void PingPong::eventFunction(){ |
| 163 | 111 |
| 164 | 112 logging_info( "pinging our remote nodes" ); |
| 165 | 113 |
| 166 | 114 RemoteNodes::iterator i = remoteNodes.begin(); |
| 167 | 115 RemoteNodes::iterator iend = remoteNodes.end(); |
| 168 | 116 |
| 169 | 117 pingid++; |
| 170 | 118 |
| 171 | 119 for( ; i != iend; i++ ){ |
| 172 | 120 logging_info( " -> pinging " << i->first ); |
| 173 | 121 |
| 174 | 122 PingPongMessage pingmsg( pingid ); |
| 175 | 123 overlay->sendMessage( &pingmsg, i->second ); |
| 176 | 124 } |
| 177 | 125 } |
| 178 | }}} |
| 179 | |
| 180 | Everytime the timer 'fires', ''eventFunction'' is called on a node (lines 110-125). In this example, the initiator sends a message to every node that has joined up to this point in time. To accomplish this, it iterates through all established links (line 119), builts a message for every link and finally sends the message using the Base Overlay in ''Ariba''. |
| 181 | |