Changeset 3705 for source/ariba/overlay/modules
- Timestamp:
- May 26, 2009, 4:27:55 PM (16 years ago)
- Location:
- source/ariba/overlay/modules
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/overlay/modules/OverlayInterface.cpp
r3690 r3705 75 75 bool OverlayInterface::onLinkRequest(const NodeID& remote, 76 76 const DataMessage& msg) { 77 return true; 77 78 } 78 79 -
source/ariba/overlay/modules/onehop/OneHop.cpp
r3690 r3705 59 59 // 60 60 overlayNodes.insert( make_pair(_nodeid, LinkID::UNSPECIFIED) ); 61 62 Timer::setInterval(5000); 63 Timer::start(); 61 64 } 62 65 63 66 OneHop::~OneHop(){ 67 Timer::stop(); 64 68 deleteOverlay(); 65 69 } … … 155 159 156 160 // 157 // close all links, this will indicate the other nodes that we left 161 // send leave messages to all nodes. the nodes 162 // will then drop the links 158 163 // 159 164 … … 162 167 163 168 for( ; i != iend; i++){ 164 if( i->first != nodeid && i->second != LinkID::UNSPECIFIED ) 165 baseoverlay.dropLink( i->second ); 169 if( i->first != nodeid && i->second != LinkID::UNSPECIFIED ){ 170 171 OneHopMessage msg (OneHopMessage::OneHopMessageTypeLeave); 172 baseoverlay.sendMessage( &msg, i->second ); 173 } 166 174 } 167 175 … … 177 185 178 186 // node went down, remove from overlay mapping 179 logging_debug( " node " << remote.toString() << " left overlay structure" );187 logging_debug( "link " << lnk.toString() << " to node " << remote.toString() << " went down, removing node" ); 180 188 181 189 OverlayNodeMapping::iterator i = overlayNodes.begin(); … … 266 274 eventsReceiver->onNodeJoin( remote ); 267 275 268 } // if( request != NULL )276 } // OneHopMessageTypeListingRequest 269 277 270 278 // … … 312 320 } // for( ; i != iend; i++ ) 313 321 314 } // if( reply != NULL ) 322 } // OneHopMessageTypeListingReply 323 324 // 325 // handle node leaves 326 // 327 328 if( onemsg->isType(OneHopMessage::OneHopMessageTypeLeave) ){ 329 330 logging_debug("received leave message from " << 331 remote.toString() << " on link " << lnk.toString()); 332 333 // drop the link to the node 334 baseoverlay.dropLink( lnk ); 335 336 } // OneHopMessageTypeLeave 337 338 // 339 // handle kbr route messages 340 // 315 341 316 342 if( onemsg->isType( OneHopMessage::OneHopMessageTypeRoute) ){ 317 343 logging_debug( "Route message arrived at destination node -> delegate to BaseOverlay" ); 318 344 baseoverlay.incomingRouteMessage( onemsg ); 319 } 320 345 } // OneHopMessageTypeRoute 346 347 } 348 349 void OneHop::eventFunction(){ 350 351 logging_debug("<<<<<<<<<<<<<<<<onehop-table<<<<<<<<<<<<<<<<<<<"); 352 353 OverlayNodeMapping::iterator i = overlayNodes.begin(); 354 OverlayNodeMapping::iterator iend = overlayNodes.end(); 355 356 for( ; i != iend; i++ ){ 357 358 const NodeID node = i->first; 359 const LinkID link = i->second; 360 const EndpointDescriptor& endpoint = baseoverlay.getEndpointDescriptor( link ); 361 362 logging_debug( "node: " << node.toString() << 363 ", link_: " << link.toString() << ", endp: " << endpoint.toString()); 364 } 365 366 logging_debug(">>>>>>>>>>>>>>>>>onehop-table>>>>>>>>>>>>>>>>>>>>>"); 321 367 322 368 } -
source/ariba/overlay/modules/onehop/OneHop.h
r3690 r3705 43 43 #include "ariba/overlay/modules/OverlayInterface.h" 44 44 #include "ariba/utility/logging/Logging.h" 45 #include "ariba/utility/system/Timer.h" 45 46 46 47 using std::map; 48 using ariba::utility::Timer; 47 49 48 50 namespace ariba { 49 51 namespace overlay { 50 52 51 class OneHop : public OverlayInterface{53 class OneHop : public OverlayInterface, protected Timer { 52 54 use_logging_h( OneHop ); 53 55 public: … … 58 60 59 61 protected: 62 63 /// @see Timer.h 64 virtual void eventFunction(); 65 60 66 /// @see OverlayInterface.h 61 67 virtual void createOverlay(); -
source/ariba/overlay/modules/onehop/messages/OneHopMessage.h
r3690 r3705 57 57 OneHopMessageTypeListingRequest = 1, 58 58 OneHopMessageTypeListingReply = 2, 59 OneHopMessageTypeRoute = 3, 59 OneHopMessageTypeLeave = 3, 60 OneHopMessageTypeRoute = 4, 60 61 } OneHopMessageType; 61 62
Note:
See TracChangeset
for help on using the changeset viewer.