Changeset 6961
- Timestamp:
- Nov 18, 2009, 9:44:28 PM (15 years ago)
- Location:
- source/ariba/overlay
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/overlay/BaseOverlay.cpp
r6953 r6961 360 360 if (!ld->up) continue; 361 361 362 // check if link is relayed and retry connecting directly 363 if ( ld->relayed && ld->retryCounter > 0) { 364 ld->retryCounter--; 365 ld->communicationId = bc->establishLink( ld->endpoint ); 366 } 367 362 368 // remote used as relay flag 363 369 if ( ld->relaying && difftime( now, ld->timeRelaying ) > 10) … … 756 762 sideport(&SideportListener::DEFAULT), overlayInterface(NULL), 757 763 counter(0) { 758 dht = new DHT(); 759 localDHT = new DHT(); 764 initDHT(); 760 765 } 761 766 762 767 BaseOverlay::~BaseOverlay() { 763 de lete dht;768 destroyDHT(); 764 769 } 765 770 … … 1755 1760 1756 1761 // try to replace relay link with direct link 1757 ldn->communicationId = 1758 bc->establishLink( overlayMsg->getSourceEndpoint() ); 1762 ldn->retryCounter = 3; 1763 ldn->endpoint = overlayMsg->getSourceEndpoint(); 1764 ldn->communicationId = bc->establishLink( ldn->endpoint ); 1759 1765 1760 1766 return true; … … 2096 2102 // ---------------------------------------------------------------------------- 2097 2103 2104 void BaseOverlay::initDHT() { 2105 dht = new DHT(); 2106 localDHT = new DHT(); 2107 republishCounter = 0; 2108 } 2109 2110 void BaseOverlay::destroyDHT() { 2111 delete dht; 2112 delete localDHT; 2113 } 2114 2098 2115 /// stabilize DHT state 2099 2116 void BaseOverlay::stabilizeDHT() { 2117 2118 // do not refresh every second 2119 if (republishCounter < 2) { 2120 republishCounter++; 2121 return; 2122 } 2123 republishCounter = 0; 2124 2100 2125 // remove old values from DHT 2101 2126 BOOST_FOREACH( DHTEntry& entry, dht->entries ) { -
source/ariba/overlay/BaseOverlay.h
r6874 r6961 500 500 DHT* dht; 501 501 DHT* localDHT; 502 502 int republishCounter; 503 504 void initDHT(); 505 void destroyDHT(); 503 506 void stabilizeDHT(); 504 507 void dhtSend( OverlayMsg* msg, const NodeID& dest ); -
source/ariba/overlay/LinkDescriptor.h
r5916 r6961 10 10 #include "ariba/utility/messages.h" 11 11 #include "ariba/utility/types.h" 12 #include "ariba/communication/EndpointDescriptor.h" 12 13 #include "ariba/CommunicationListener.h" 13 14 … … 23 24 using ariba::utility::LinkID; 24 25 using ariba::CommunicationListener; 26 using ariba::communication::EndpointDescriptor; 25 27 26 28 namespace ariba { … … 55 57 this->autolink = false; 56 58 this->lastuse = time(NULL); 59 this->retryCounter = 0; 57 60 } 58 61 … … 78 81 LinkID communicationId; ///< the communication id 79 82 bool communicationUp; ///< flag, whether the communication is up 83 84 // direct link retries ----------------------------------------------------- 85 EndpointDescriptor endpoint; 86 int retryCounter; 80 87 81 88 // link alive information --------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.