Changeset 4924
- Timestamp:
- Jul 15, 2009, 8:22:38 AM (15 years ago)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sample/pingpong/main.cpp
r4920 r4924 6 6 using ariba::utility::StartupWrapper; 7 7 using ariba::application::pingpong::PingPong; 8 9 8 10 9 //************************************************* … … 16 15 StartupWrapper::startSystem(); 17 16 17 std::cout << "yyyyyyyyy!" << std::endl; 18 18 19 BootstrapManager& manager = BootstrapManager::instance(); 19 20 manager.registerModule( BootstrapManager::BootstrapTypePeriodicBroadcast ); 21 22 std::cout << "xxxxxxxxxxxxyyyyyyyyy!" << std::endl; 20 23 21 24 manager.publish("testname", "testinfo1", "testinfo2", "testinfo3"); … … 31 34 int main( int argc, char** argv ) { 32 35 33 //debug();34 //return 0;36 debug(); 37 return 0; 35 38 36 39 -
source/ariba/utility/bootstrap/modules/periodicbroadcast/PeriodicBroadcast.cpp
r4920 r4924 67 67 server(io_service, &newRemoteServices, &newRemoteServicesMutex) { 68 68 69 io_service.run(); 69 io_service_thread = new boost::thread( 70 boost::bind(&PeriodicBroadcast::threadFunc, this) ); 70 71 } 71 72 72 73 PeriodicBroadcast::~PeriodicBroadcast(){ 73 74 io_service.stop(); 75 io_service_thread->join(); 76 delete io_service_thread; 77 io_service_thread = NULL; 78 } 79 80 void PeriodicBroadcast::threadFunc(PeriodicBroadcast* obj){ 81 obj->io_service.run(); 74 82 } 75 83 -
source/ariba/utility/bootstrap/modules/periodicbroadcast/PeriodicBroadcast.h
r4921 r4924 113 113 114 114 boost::asio::io_service io_service; 115 boost::thread* io_service_thread; 116 static void threadFunc(PeriodicBroadcast* obj); 115 117 116 118 class udp_server {
Note:
See TracChangeset
for help on using the changeset viewer.