// We have some cancelled operations for which we need to invoke the
// handlers with the operation_aborted error code.
+ getIOService()->stop();
getIOService()->restart();
getIOService()->poll();
// We have some cancelled operations for which we need to invoke the
// handlers with the operation_aborted error code.
+ getIOService()->stop();
getIOService()->restart();
getIOService()->poll();
elapsed.total_milliseconds() <= 400);
timer.cancel();
+ getIOService()->stop();
getIOService()->restart();
try {
getIOService()->poll();
D2Process::~D2Process() {
queue_mgr_->stopListening();
+ getIOService()->stop();
getIOService()->restart();
try {
getIOService()->poll();
elapsed.total_milliseconds() <= 2200);
timer.cancel();
+ getIOService()->stop();
getIOService()->restart();
try {
getIOService()->poll();
elapsed.total_milliseconds() <= 2200);
timer.cancel();
+ getIOService()->stop();
getIOService()->restart();
try {
getIOService()->poll();
sender_->stopSending();
queue_mgr_->stopListening();
test_timer_.cancel();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
if (server_) {
server_->stop();
}
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
}
LOG_ERROR(dhcp4_logger, DHCP4_SRV_UNLOAD_LIBRARIES_ERROR).arg(msg);
}
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
while (!stopped && (!cond || !cond())) {
io_service->runOne();
}
+ io_service->stop();
io_service->restart();
}
}
LOG_ERROR(dhcp6_logger, DHCP6_SRV_UNLOAD_LIBRARIES_ERROR).arg(msg);
}
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
virtual ~NakedDhcpv6Srv() {
// Close the lease database
isc::dhcp::LeaseMgrFactory::destroy();
-
+ getIOService()->stop();
getIOService()->restart();
try {
getIOService()->poll();
while (!stopped && (!cond || !cond())) {
io_service->runOne();
}
+ io_service->stop();
io_service->restart();
}
io_service->run();
client.stop();
+ io_service->stop();
io_service->restart();
try {
io_service->poll();
thread_.reset();
}
removeUnixSocketFile();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
if (listener_) {
listener_->stop();
}
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
EXPECT_TRUE(elapsed.total_milliseconds() >= 100 &&
elapsed.total_milliseconds() <= 400);
timer.cancel();
+ getIOService()->stop();
getIOService()->restart();
try {
getIOService()->poll();
responses_.clear();
removeUnixSocketFile();
SysrepoSetup::cleanSharedMemory();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
client.stop();
+ io_service->stop();
io_service->restart();
try {
io_service->poll();
client.stop();
+ io_service->stop();
io_service->restart();
try {
io_service->poll();
client.stop();
+ io_service->stop();
io_service->restart();
try {
io_service->poll();
client.stop();
+ io_service->stop();
io_service->restart();
try {
io_service->poll();
client.stop();
+ io_service->stop();
io_service->restart();
try {
io_service->poll();
/// @brief Destructor.
~HAImplTest() {
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
}
ha_impl_.reset();
test_ha_impl_.reset();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
checkAnswer(response, CONTROL_RESULT_ERROR, expected_response);
callout_handle.reset();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
} catch (...) {
}
ha_impl_.reset();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
///
/// Stops all test servers.
~HAMtServiceTest() {
+ io_service_->stop();
io_service_->restart();
- io_service_->poll();
+ try {
+ io_service_->poll();
+ } catch (...) {
+ }
MultiThreadingMgr::instance().setMode(false);
CmdResponseCreator::command_accept_list_.clear();
}
listener_->stop();
listener2_->stop();
listener3_->stop();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
// Change the partner's response to success.
factory2_->getResponseCreator()->setControlResult(CONTROL_RESULT_SUCCESS);
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
}
~HAServiceStateMachineTest() {
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
if (timer_) {
timer_->cancel();
}
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
void
HATest::runIOService(long ms) {
+ io_service_->stop();
io_service_->restart();
timer_.reset(new IntervalTimer(io_service_));
timer_->setup(std::bind(&IOService::stop, io_service_), ms,
void
HATest::runIOService(long ms, std::function<bool()> stop_condition) {
+ io_service_->stop();
io_service_->restart();
timer_.reset(new IntervalTimer(io_service_));
bool timeout = false;
boost::shared_ptr<std::thread>
HATest::runIOServiceInThread() {
+ io_service_->stop();
io_service_->restart();
bool running = false;
virtual ~IOFetchTest() {
shutdown_ = true;
timer_.cancel();
+ service_->stop();
service_->restart();
try {
service_->poll();
timer_cancel_success_(false) {
}
~IntervalTimerTest() {
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
io_signal_set_->remove(SIGCHLD);
io_signal_set_.reset();
// Make sure the cancel handler for the IOSignalSet is called.
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
virtual ~TCPAcceptorTest() {
running_ = false;
test_timer_.cancel();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
virtual ~TLSAcceptorTest() {
running_ = false;
test_timer_.cancel();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
/// @brief Destructor.
virtual ~TLSTest() {
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
virtual ~UnixDomainSocketTest() {
removeUnixSocketFile();
test_socket_.reset();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
}
if (thread_io_service_) {
+ thread_io_service_->stop();
thread_io_service_->restart();
try {
thread_io_service_->poll();
} catch (...) {
}
+ thread_io_service_->stop();
}
// Get rid of the thread pool.
// Stop the listener.
http_listener_->stop();
+ thread_io_service_->stop();
thread_io_service_->restart();
try {
thread_io_service_->poll();
} catch (...) {
}
+ thread_io_service_->stop();
// Get rid of the thread pool.
thread_pool_.reset();
removeUnixSocketFile();
conn_.reset();
test_socket_.reset();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
}
test_timer_.cancel();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
// Loop until the clients are done, an error occurs, or the time runs out.
size_t num_done = 0;
while (num_done != request_limit) {
- // Always call restart() before we call run();
+ io_service_->stop();
io_service_->restart();
// Run until a client stops the service.
virtual ~DNSClientTest() {
test_timer_.cancel();
dns_client_->stop();
+ service_->stop();
service_->restart();
try {
service_->poll();
// Since the callback, operator(), calls stop() on the io_service,
// we must reset it in order for subsequent calls to run() or
// runOne() to work.
+ service_->stop();
service_->restart();
try {
service_->poll();
// Since the callback, operator(), calls stop() on the io_service,
// we must reset it in order for subsequent calls to run() or
// runOne() to work.
+ service_->stop();
service_->restart();
try {
service_->poll();
virtual ~NameChangeTransactionTest() {
timer_->cancel();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
TimedIO::~TimedIO() {
timer_->cancel();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
if (io_service_) {
try {
+ io_service_->stop();
io_service_->restart();
io_service_->poll();
} catch (const std::exception& ex) {
virtual ~NameChangeUDPListenerTest() {
test_timer_.cancel();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
~NameChangeUDPTest() {
test_timer_.cancel();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
}
if (private_io_service_) {
+ private_io_service_->stop();
private_io_service_->restart();
try {
private_io_service_->poll();
/// timers.
virtual ~CfgExpirationTimersTest() {
cleanupTimerMgr();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
}, timeout_ms, IntervalTimer::ONE_SHOT);
io_service_->run();
+ io_service_->stop();
io_service_->restart();
}
io_service_->stop();
}, timeout, asiolink::IntervalTimer::ONE_SHOT);
io_service_->run();
+ io_service_->stop();
io_service_->restart();
}
// Disable multi-threading.
MultiThreadingMgr::instance().setMode(false);
+ getIOService()->stop();
getIOService()->restart();
try {
getIOService()->poll();
}, ms, IntervalTimer::ONE_SHOT);
io_service_->run();
+ io_service_->stop();
io_service_->restart();
}
}, 1, IntervalTimer::REPEATING);
io_service_->run();
+ io_service_->stop();
io_service_->restart();
return (!elapsed);
}
TimerMgrTest::TearDown() {
// Remove all timers.
timer_mgr_->unregisterTimers();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
io_service_->stop();
}, timeout, IntervalTimer::ONE_SHOT);
io_service_->run();
+ io_service_->stop();
io_service_->restart();
}
}
if (thread_io_service_) {
+ thread_io_service_->stop();
thread_io_service_->restart();
try {
thread_io_service_->poll();
}
test_timer_.cancel();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
/// have been carried out or the test fails.
void runIOService(size_t request_limit) {
while (getRRCount() < request_limit) {
- // Always call reset() before we call run();
+ io_service_->stop();
io_service_->restart();
// Run until a client stops the service.
/// @brief Destructor.
~HttpConnectionPoolTest() {
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
client->close();
}
test_timer_.cancel();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
/// @param timeout Optional value specifying for how long the io service
/// should be ran.
void runIOService(long timeout = 0) {
+ io_service_->stop();
io_service_->restart();
if (timeout > 0) {
timeout, IntervalTimer::ONE_SHOT);
}
io_service_->run();
+ io_service_->stop();
io_service_->restart();
io_service_->poll();
}
listener_.stop();
listener2_.stop();
listener3_.stop();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
/// @brief Destructor.
virtual ~HttpListenerTest() {
test_timer_.cancel();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
/// @param timeout Optional value specifying for how long the io service
/// should be ran (ms).
void runIOService(long timeout = 0) {
+ io_service_->stop();
io_service_->restart();
if (timeout > 0) {
timeout, IntervalTimer::ONE_SHOT);
}
io_service_->run();
+ io_service_->stop();
io_service_->restart();
io_service_->poll();
}
client->close();
}
test_timer_.cancel();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
/// @param timeout Optional value specifying for how long the io service
/// should be ran.
void runIOService(long timeout = 0) {
+ io_service_->stop();
io_service_->restart();
if (timeout > 0) {
timeout, IntervalTimer::ONE_SHOT);
}
io_service_->run();
+ io_service_->stop();
io_service_->restart();
io_service_->poll();
}
/// @brief Destructor
virtual ~DProcessBase() {
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
}
if (thread_io_service_) {
+ thread_io_service_->stop();
thread_io_service_->restart();
try {
thread_io_service_->poll();
} catch (...) {
}
+ thread_io_service_->stop();
}
// Get rid of the thread pool.
// Stop the listener.
tcp_listener_->stop();
+ thread_io_service_->stop();
thread_io_service_->restart();
try {
thread_io_service_->poll();
} catch (...) {
}
+ thread_io_service_->stop();
// Get rid of the thread pool.
thread_pool_.reset();
}
test_timer_.cancel();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
// Loop until the clients are done, an error occurs, or the time runs out.
size_t num_done = 0;
while (num_done != request_limit) {
- // Always call restart() before we call run();
+ io_service_->stop();
io_service_->restart();
// Run until a client stops the service.
}
test_timer_.cancel();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
/// @param timeout Optional value specifying for how long the io service
/// should be ran.
void runIOService(long timeout = 0) {
+ io_service_->stop();
io_service_->restart();
if (timeout > 0) {
IntervalTimer::ONE_SHOT);
}
io_service_->run();
+ io_service_->stop();
io_service_->restart();
io_service_->poll();
}
}
test_timer_.cancel();
+ io_service_->stop();
io_service_->restart();
try {
io_service_->poll();
/// @param timeout Optional value specifying for how long the io service
/// should be ran.
void runIOService(long timeout = 0) {
+ io_service_->stop();
io_service_->restart();
if (timeout > 0) {
IntervalTimer::ONE_SHOT);
}
io_service_->run();
+ io_service_->stop();
io_service_->restart();
io_service_->poll();
}