Ignore:
Timestamp:
Aug 11, 2009, 4:22:48 PM (15 years ago)
Author:
Christoph Mayer
Message:

sideport fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/SideportListener.cpp

    r5871 r5872  
    8585bool SideportListener::isRelayedNode(const NodeID& node){
    8686        if( overlay == NULL ) return false;
    87 /*
     87
    8888        bool relay = false;
    8989
     
    9191
    9292                // is we find a direct connection this is not a relayed node
    93                 if(link->relay == false && link->remoteNode == node && link->up)
     93                if(link->relayed == false && link->remoteNode == node && link->up)
    9494                        return false;
    9595
    96                 // if we find a relay conenction this can be a relayed node
     96                // if we find a relay connection this can be a relayed node
    9797                // but only if we find no direct connection as above
    98                 if( link->relay && link->remoteNode == node && link->up)
     98                if( link->relayed && link->remoteNode == node && link->up)
    9999                        relay = true;
    100100        }
    101101
    102102        return relay;
    103         */
    104 
    105         return false;
    106103}
    107104
    108105bool SideportListener::isRelayingNode(const NodeID& node){
    109106        if( overlay == NULL ) return false;
    110 /*
     107
    111108        BOOST_FOREACH( LinkDescriptor* link, overlay->links ){
    112                 if( link->relay && link->localRelay == node && link->up)
     109                if( link->relaying && link->remoteNode == node && link->up)
    113110                        return true;
    114111        }
    115 */
     112
    116113        return false;
    117114}
     
    122119
    123120        using namespace ariba::addressing;
    124 /*
    125         LinkDescriptor* link = overlay->getSendDescriptor(node);
    126         if (link==NULL) return (Protocol)ret;
     121
     122        LinkDescriptor* link = NULL;
     123        BOOST_FOREACH( LinkDescriptor* lnk, overlay->links ){
     124                if(lnk->up && lnk->remoteNode == node && !lnk->relayed && lnk->communicationUp){
     125                        link = lnk;
     126                        break;
     127                }
     128        }
     129
     130        if (link == NULL) return (Protocol)ret;
    127131
    128132        BaseCommunication::LinkDescriptor& bclink =
     
    145149                ret = SideportListener::rfcomm;
    146150        }
    147 */
     151
    148152        return (Protocol)ret;
    149153}
Note: See TracChangeset for help on using the changeset viewer.