Changeset 7744 for source/ariba/communication/BaseCommunication.cpp
- Timestamp:
- Mar 11, 2010, 9:28:24 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/communication/BaseCommunication.cpp
r7496 r7744 38 38 39 39 #include "BaseCommunication.h" 40 40 41 #include "networkinfo/AddressDiscovery.h" 42 #include "ariba/utility/types/PeerID.h" 41 43 42 44 #ifdef UNDERLAY_OMNET … … 52 54 namespace ariba { 53 55 namespace communication { 56 57 using ariba::utility::PeerID; 54 58 55 59 use_logging_cpp(BaseCommunication); … … 100 104 currentSeqnum = 0; 101 105 106 // set local peer id 107 localDescriptor.getPeerId() = PeerID::random(); 108 logging_info( "Using PeerID: " << localDescriptor.getPeerId() ); 109 102 110 // creating transports 103 111 logging_info( "Creating transports ..." ); … … 114 122 115 123 logging_info( "Searching for local locators ..." ); 116 if(localDescriptor.getEndpoints().to_string().length() == 0) 117 AddressDiscovery::discover_endpoints( localDescriptor.getEndpoints() ); 124 /** 125 * DONT DO THAT: if(localDescriptor.getEndpoints().to_string().length() == 0) 126 * since addresses are used to initialize transport addresses 127 */ 128 AddressDiscovery::discover_endpoints( localDescriptor.getEndpoints() ); 118 129 logging_info( "Done. Local endpoints = " << localDescriptor.toString() ); 119 130 … … 177 188 AribaBaseMsg baseMsg( AribaBaseMsg::typeLinkRequest, linkid ); 178 189 baseMsg.getLocalDescriptor() = localDescriptor; 190 baseMsg.getRemoteDescriptor().getPeerId() = descriptor.getPeerId(); 179 191 180 192 // serialize and send message … … 338 350 logging_debug( "Received link open request" ); 339 351 352 /// not the correct peer id-> skip request 353 if (!msg->getRemoteDescriptor().getPeerId().isUnspecified() 354 && msg->getRemoteDescriptor().getPeerId() != localDescriptor.getPeerId()) { 355 logging_info("Received link request for " 356 << msg->getRemoteDescriptor().getPeerId().toString() 357 << "but i'm " 358 << localDescriptor.getPeerId() 359 << ": Ignoring!"); 360 break; 361 } 362 340 363 /// only answer the first request 341 364 if (!queryRemoteLink(msg->getLocalLink()).isUnspecified()) {
Note:
See TracChangeset
for help on using the changeset viewer.