Project

General

Profile

Bug #1759

Updated by Junxiao Shi almost 10 years ago

In certain cases, previous version caused connect() to fail (stopped io\_service io_service due to exception) before send() is dispatched.    This could have resulted in incorrectly calling Transport::send with old buffer when io\_service io_service resumes. 

 The following code snippet (from NFD Control Center) that ensures that face is still alive and retries when face fails can cause the described problem 

       while (true) { 
         try { 
           while (true) { 
             m_face.expressInterest(Interest("/localhost/nfd/status"), 
                                    bind(&Ncc::onStatusRetrieved, this, _2), 
                                    bind(&Ncc::onStatusTimeout, this)); 
             m_face.processEvents(time::milliseconds::zero(), true); 
           } 
         } 
         catch (const std::exception&e) { 
           boost::this_thread::sleep(boost::posix_time::seconds(1)); 
         } 
       } 

 To cause problem, start snippet with stopped NFD or stop/start NFD while snippet is running.

Back