void loop() { boost::asio::io_service::work work(getIoService()); while (isAlive()) { boost::system::error_code ec; getIoService().reset(); if (!getIoService().run(ec)) { std::this_thread::sleep_for(std::chrono::milliseconds(10)); } } *mLog.debug() << UTILS_STR_FUNCTION << ", done"; }
const InterestFilterId* Face::setInterestFilter(const InterestFilter& interestFilter, const OnInterest& onInterest) { shared_ptr<InterestFilterRecord> filter = make_shared<InterestFilterRecord>(interestFilter, onInterest); getIoService().post(bind(&Impl::asyncSetInterestFilter, m_impl, filter)); return reinterpret_cast<const InterestFilterId*>(filter.get()); }