// prevents us from waiting 1 second on more before the timer goes off.
// Instead, we wait one millisecond which significantly reduces the
// test time.
- if (server_->getServerPort() != 0) {
+ if (!server_->inTestMode()) {
fetch_time = 1000 * fetch_time;
}
/// @brief Destructor. Used during DHCPv4 service shutdown.
virtual ~Dhcpv4Srv();
+ /// @brief Checks if the server is running in a test mode.
+ ///
+ /// @return true if the server is running in the test mode,
+ /// false otherwise.
+ bool inTestMode() const {
+ return (server_port_ == 0);
+ }
+
/// @brief Returns pointer to the IO service used by the server.
asiolink::IOServicePtr& getIOService() {
return (io_service_);