Changeset 5481 for source/ariba
- Timestamp:
- Jul 30, 2009, 1:06:58 PM (15 years ago)
- Location:
- source/ariba
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/overlay/BaseOverlay.cpp
r5464 r5481 114 114 115 115 /// find a proper relay node 116 const NodeID BaseOverlay::findRelayNode( const NodeID &id ) {116 const NodeID BaseOverlay::findRelayNode( const NodeID id ) { 117 117 LinkDescriptor* rld = NULL; 118 118 NodeID relayNode = NodeID::UNSPECIFIED; … … 133 133 else relayNode = rld->remoteNode; 134 134 } 135 logging_force( "Potential relay node " << relayNode.toString() ); 135 136 // if first relay is unknown choose a arbitrary direct node as relay 137 if ( relayNode.isUnspecified() ) { 138 for (size_t i=0; i<links.size(); i++) 139 if (links[i]->up && 140 links[i]->communicationUp && 141 !links[i]->relay && 142 links[i]->keepAliveMissed <= 1 && 143 links[i]->service == OverlayInterface::OVERLAY_SERVICE_ID) { 144 relayNode = links[i]->remoteNode; 145 break; 146 } 147 } 148 136 149 // do not return myself or use the node as relay node 137 150 if (relayNode == nodeId) … … 189 202 } 190 203 204 /// routes a message over the overlay or directly sends it when a link is open 205 seqnum_t BaseOverlay::sendOverlay( Message* message, const NodeID& nodeid ) { 206 for (size_t i=0; i<links.size(); i++) 207 if ( links[i]->up && 208 links[i]->communicationUp && 209 !links[i]->relay && 210 links[i]->keepAliveMissed <= 1 && 211 links[i]->remoteNode == nodeid && 212 links[i]->service == OverlayInterface::OVERLAY_SERVICE_ID) { 213 return sendMessage( message, links[i] ); 214 break; 215 } 216 overlayInterface->routeMessage(nodeid, message); 217 return 0; 218 } 219 191 220 /// creates a link descriptor, apply relay semantics if possible 192 221 LinkDescriptor* BaseOverlay::createLinkDescriptor( 193 const NodeID & remoteNode, const ServiceID& service, const LinkID&link_id ) {222 const NodeID remoteNode, const ServiceID service, const LinkID link_id ) { 194 223 195 224 // find listener … … 1321 1350 if (relayMsg->getRelayNode() == nodeId || relayMsg->getRelayNode().isUnspecified()) { 1322 1351 logging_info("Routing relay message to " << relayMsg->getDestNode().toString() ); 1323 overlayInterface->routeMessage(relayMsg->getDestNode(), &_overMsg);1352 sendOverlay( &_overMsg, relayMsg->getDestNode() ); 1324 1353 } else { 1325 1354 logging_info("Routing relay message to " << relayMsg->getRelayNode().toString() ); 1326 overlayInterface->routeMessage(relayMsg->getRelayNode(), &_overMsg);1355 sendOverlay( &_overMsg, relayMsg->getRelayNode() ); 1327 1356 } 1328 1357 return true; … … 1354 1383 1355 1384 /// this must be handled by using relay link! 1356 overlayInterface->routeMessage(relayMsg->getDestNode(), &_overMsg);1385 sendOverlay(&_overMsg, relayMsg->getDestNode()); 1357 1386 return true; 1358 1387 } -
source/ariba/overlay/BaseOverlay.h
r5316 r5481 415 415 416 416 /// find a proper relay node that is directly connected to this node 417 const NodeID findRelayNode( const NodeID &id );417 const NodeID findRelayNode( const NodeID id ); 418 418 419 419 /// forwards a message over relays/overlay/directly using link descriptor 420 420 seqnum_t sendMessage( Message* message, const LinkDescriptor* ld ); 421 421 422 /// routes a message over the overlay or directly sends it when a link is open 423 seqnum_t sendOverlay( Message* message, const NodeID& nodeid ); 424 422 425 /// creates a link descriptor, applys relay semantics if possible 423 426 LinkDescriptor* createLinkDescriptor( 424 const NodeID & remoteNode, const ServiceID& service, const LinkID&link_id );427 const NodeID remoteNode, const ServiceID service, const LinkID link_id ); 425 428 426 429 // map of a link request map a nonce to a LinkID -
source/ariba/utility/messages/Message.h
r3710 r5481 209 209 T* payloadMsg = new T(); 210 210 data_deserialize( payloadMsg, payload ); 211 dropPayload(); 211 212 return payloadMsg; 212 213 } -
source/ariba/utility/system/StartupWrapper.cpp
r5479 r5481 126 126 log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger("rfcomm")); 127 127 logger->setLevel(log4cxx::Level::getAll()); 128 } 128 }*/ 129 129 */ 130 130 -
source/ariba/utility/transport/rfcomm/rfcomm.cpp
r5444 r5481 354 354 // check error 355 355 if (error) { 356 logging_error("Failed to receive message payload. Error code: " 357 << error.message() ); 356 logging_error("Failed to receive message payload. Error: " << error.message() ); 358 357 shutdown(info); 359 358 return; … … 384 383 if (info->sending || !info->up || info->send_buffer.size()==0) return; 385 384 385 // set sending flag 386 386 info->sending = true; 387 logging_debug("Sending messages ...");388 387 389 388 // safely remove data from deque … … 415 414 // handle error 416 415 if (error) { 417 logging_error( "Message sent error. Error code: "<< error.message() );416 logging_error( "Message sent error. Error: " << error.message() ); 418 417 info->sending = false; 419 418 shutdown(info);
Note:
See TracChangeset
for help on using the changeset viewer.