Changeset 5973 for source/ariba/utility/bootstrap
- Timestamp:
- Aug 15, 2009, 3:34:30 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/utility/bootstrap/modules/periodicbroadcast/PeriodicBroadcast.h
r5638 r5973 341 341 342 342 void handle_info(boost::array<char, 1500>& buffer, std::size_t length){ 343 PeriodicBroadcastMessage msg; 344 345 Data data( (uint8_t*)buffer.data(), length*8 ); 346 data_deserialize( msg, data ); 347 348 { // insert new found service 349 boost::mutex::scoped_lock( *servicesmutex ); 350 351 ServiceList::iterator it = services->find( msg.getName() ); 352 if( it != services->end() ){ 353 354 /* 355 it->second.setInfo1( msg.getInfo1() ); 356 it->second.setInfo2( msg.getInfo2() ); 357 it->second.setInfo3( msg.getInfo3() ); 358 */ 359 it->second.setLastseen( time(NULL) ); 360 361 } else { 362 Service s( msg.getName(), msg.getInfo1(), msg.getInfo2(), msg.getInfo3(), time(NULL)); 363 services->insert( std::make_pair(msg.getName(), s) ); 343 344 try { 345 346 PeriodicBroadcastMessage msg; 347 348 Data data( (uint8_t*)buffer.data(), length*8 ); 349 data_deserialize( msg, data ); 350 351 { // insert new found service 352 boost::mutex::scoped_lock( *servicesmutex ); 353 354 ServiceList::iterator it = services->find( msg.getName() ); 355 if( it != services->end() ){ 356 it->second.setLastseen( time(NULL) ); 357 } else { 358 Service s( msg.getName(), msg.getInfo1(), msg.getInfo2(), msg.getInfo3(), time(NULL)); 359 services->insert( std::make_pair(msg.getName(), s) ); 360 } 364 361 } 362 363 }catch(...){ 364 /* ignore error */ 365 365 } 366 366 }
Note:
See TracChangeset
for help on using the changeset viewer.