Changeset 5967 for source/ariba/overlay


Ignore:
Timestamp:
Aug 14, 2009, 6:44:45 PM (15 years ago)
Author:
Christoph Mayer
Message:

rfcomm sdp fixing

Location:
source/ariba/overlay
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/overlay/OverlayBootstrap.cpp

    r5953 r5967  
    3838
    3939#include "OverlayBootstrap.h"
     40
    4041#include "BaseOverlay.h"
     42#include "ariba/utility/bootstrap/modules/bluetoothsdp/BluetoothSdp.h"
     43
     44using ariba::utility::BluetoothSdp;
    4145
    4246namespace ariba {
     
    5155                nodeid( NodeID::UNSPECIFIED ),
    5256                overlay( NULL ),
    53                 watchtimer(this) {
     57                watchtimer(this),
     58                haveOverlayConnection(false){
    5459
    5560        srand(time(NULL));
     61
     62        BluetoothSdp::CONNECTION_CHECKER = this;
    5663}
    5764
     
    162169
    163170        lastJoines.push_front(data);
     171}
     172
     173bool OverlayBootstrap::haveOverlayConnections(){
     174        boost::mutex::scoped_lock lock(haveOverlayConnectionMutex);
     175        return haveOverlayConnection;
    164176}
    165177
     
    175187        }
    176188
    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;
    187195        }
    188196
    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
    197198        logging_info("overlay not joined, checking for earlier used bootstrap information");
    198199        EndpointDescriptor joinep = EndpointDescriptor::UNSPECIFIED();
  • source/ariba/overlay/OverlayBootstrap.h

    r5860 r5967  
    9090
    9191        void recordJoin(const EndpointDescriptor& _ep);
     92        bool haveOverlayConnections();
    9293
    9394protected:
     
    134135        WatchdogTimer watchtimer;
    135136        void checkOverlayStatus();
     137
     138
     139        bool haveOverlayConnection;
     140        boost::mutex haveOverlayConnectionMutex;
    136141};
    137142
Note: See TracChangeset for help on using the changeset viewer.