Changeset 5967
- Timestamp:
- Aug 14, 2009, 6:44:45 PM (15 years ago)
- Location:
- source/ariba
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/overlay/OverlayBootstrap.cpp
r5953 r5967 38 38 39 39 #include "OverlayBootstrap.h" 40 40 41 #include "BaseOverlay.h" 42 #include "ariba/utility/bootstrap/modules/bluetoothsdp/BluetoothSdp.h" 43 44 using ariba::utility::BluetoothSdp; 41 45 42 46 namespace ariba { … … 51 55 nodeid( NodeID::UNSPECIFIED ), 52 56 overlay( NULL ), 53 watchtimer(this) { 57 watchtimer(this), 58 haveOverlayConnection(false){ 54 59 55 60 srand(time(NULL)); 61 62 BluetoothSdp::CONNECTION_CHECKER = this; 56 63 } 57 64 … … 162 169 163 170 lastJoines.push_front(data); 171 } 172 173 bool OverlayBootstrap::haveOverlayConnections(){ 174 boost::mutex::scoped_lock lock(haveOverlayConnectionMutex); 175 return haveOverlayConnection; 164 176 } 165 177 … … 175 187 } 176 188 177 // TODO: --> SIGCOMM hack <-- 178 // if we have no overlay neighbors, make sure sdp is loaded 179 // sdp searching is turned off when we have bootstrapped 180 if(overlay->getOverlayNeighbors().size() > 0){ 181 182 // switch off sdp when we we _are_ in the spovnet already 183 if(manager.isModuleRegistered(BootstrapManager::BootstrapTypeBluetoothSdp)) 184 manager.unregisterModule(BootstrapManager::BootstrapTypeBluetoothSdp); 185 186 return; 189 { 190 boost::mutex::scoped_lock lock(haveOverlayConnectionMutex); 191 haveOverlayConnection = overlay->getOverlayNeighbors().size() > 0; 192 193 // we have overlay neighbors -> ok nothing to do 194 if(haveOverlayConnection > 0) return; 187 195 } 188 196 189 // make sure sdp is running when we are _not_ in the spovnet 190 if(!manager.isModuleRegistered(BootstrapManager::BootstrapTypeBluetoothSdp)) 191 manager.registerModule(BootstrapManager::BootstrapTypeBluetoothSdp); 192 193 // 194 // we have overlay neighbors -> ok 195 // 196 197 // no overlay neighbors, see if we can join using old information 197 198 logging_info("overlay not joined, checking for earlier used bootstrap information"); 198 199 EndpointDescriptor joinep = EndpointDescriptor::UNSPECIFIED(); -
source/ariba/overlay/OverlayBootstrap.h
r5860 r5967 90 90 91 91 void recordJoin(const EndpointDescriptor& _ep); 92 bool haveOverlayConnections(); 92 93 93 94 protected: … … 134 135 WatchdogTimer watchtimer; 135 136 void checkOverlayStatus(); 137 138 139 bool haveOverlayConnection; 140 boost::mutex haveOverlayConnectionMutex; 136 141 }; 137 142 -
source/ariba/utility/bootstrap/modules/bluetoothsdp/BluetoothSdp.cpp
r5953 r5967 38 38 39 39 #include "BluetoothSdp.h" 40 #include "ariba/overlay/OverlayBootstrap.h" 40 41 41 42 #ifdef HAVE_BLUETOOTH_BLUETOOTH_H … … 62 63 namespace ariba { 63 64 namespace utility { 65 64 66 use_logging_cpp(BluetoothSdp); 67 OverlayBootstrap* BluetoothSdp::CONNECTION_CHECKER = NULL; 65 68 66 69 BluetoothSdp::BluetoothSdp(BootstrapInformationCallback* _callback) : … … 258 261 // 259 262 260 //if(!haveConnections()){263 if(!haveConnections()){ 261 264 262 265 /* … … 304 307 close(sock); 305 308 306 //} else {307 //logging_debug("have active rfcomm connections, notsearching");308 //}309 310 int nextscan = (rand() % 5) + 3;309 } else { 310 logging_debug("have active connections, no sdp searching"); 311 } 312 313 int nextscan = (rand() % 10) + 5; 311 314 logging_debug("next sdp scan try in " << nextscan << " seconds"); 312 315 … … 419 422 bool BluetoothSdp::haveConnections(){ 420 423 424 // TODO: currently we check for overlay connectivity 425 426 if(CONNECTION_CHECKER == NULL) return false; 427 return CONNECTION_CHECKER->haveOverlayConnections(); 428 429 430 /* TODO: this will check for rfcomm connections 421 431 struct hci_conn_list_req* cl = NULL; 422 432 struct hci_conn_info* ci = NULL; … … 445 455 446 456 return haveconn; 457 */ 447 458 } 448 459 -
source/ariba/utility/bootstrap/modules/bluetoothsdp/BluetoothSdp.h
r5638 r5967 65 65 66 66 namespace ariba { 67 namespace overlay { 68 class OverlayBootstrap; 69 } 70 } 71 72 using ariba::overlay::OverlayBootstrap; 73 74 namespace ariba { 67 75 namespace utility { 68 76 … … 70 78 use_logging_h(BluetoothSdp); 71 79 public: 80 static OverlayBootstrap* CONNECTION_CHECKER; 81 72 82 BluetoothSdp(BootstrapInformationCallback* _callback); 73 83 virtual ~BluetoothSdp(); -
source/ariba/utility/system/StartupWrapper.cpp
r5926 r5967 104 104 // set up again an individual level if you like 105 105 106 {106 /*{ 107 107 log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger("MCPO")); 108 108 logger->setLevel(log4cxx::Level::getDebug()); 109 109 } 110 { 111 log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger("BaseCommunication")); 112 logger->setLevel(log4cxx::Level::getDebug()); 113 }*/ 114 { 115 log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger("OverlayBootstrap")); 116 logger->setLevel(log4cxx::Level::getDebug()); 117 } 118 { 119 log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger("BootstrapManager")); 120 logger->setLevel(log4cxx::Level::getDebug()); 121 } 122 { 123 log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger("BluetoothSdp")); 124 logger->setLevel(log4cxx::Level::getDebug()); 125 } 110 126 /*{ 111 log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger("BaseCommunication"));112 logger->setLevel(log4cxx::Level::getDebug());113 }114 {115 log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger("OverlayBootstrap"));116 logger->setLevel(log4cxx::Level::getDebug());117 }118 {119 log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger("BootstrapManager"));120 logger->setLevel(log4cxx::Level::getDebug());121 }122 {123 127 log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger("Chord")); 124 128 logger->setLevel(log4cxx::Level::getInfo());
Note:
See TracChangeset
for help on using the changeset viewer.