Changeset 6961 for source/ariba/overlay/BaseOverlay.cpp
- Timestamp:
- Nov 18, 2009, 9:44:28 PM (15 years ago)
- File:
-
- 1 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 ) {
Note:
See TracChangeset
for help on using the changeset viewer.