diff --git a/backends/smstools3/main.cpp b/backends/smstools3/main.cpp index df62497e..b0ab0870 100644 --- a/backends/smstools3/main.cpp +++ b/backends/smstools3/main.cpp @@ -35,14 +35,14 @@ SMSNetworkPlugin * np = NULL; class SMSNetworkPlugin : public BoostNetworkPlugin { public: - std::shared_ptr m_timer; + std::shared_ptr m_timer; // Maps phone number -> XMPP user JID for SMS routing std::map m_numberToUser; SMSNetworkPlugin(Config *config, const std::string &host, int port) : BoostNetworkPlugin(config, host, port) { - m_timer = std::make_shared(io_context, boost::posix_time::seconds(5)); + m_timer = std::make_shared(io_context, std::chrono::seconds(5)); m_timer->async_wait(boost::bind(&SMSNetworkPlugin::handleSMSDir, this)); } @@ -95,7 +95,7 @@ class SMSNetworkPlugin : public BoostNetworkPlugin { for (directory_iterator itr(p); itr != end_itr; ++itr) { try { - if (is_regular(itr->path())) { + if (is_regular_file(itr->path())) { handleSMS(itr->path().string()); remove(itr->path()); } @@ -105,7 +105,7 @@ class SMSNetworkPlugin : public BoostNetworkPlugin { } } - m_timer->expires_from_now(boost::posix_time::seconds(5)); + m_timer->expires_after(std::chrono::seconds(5)); m_timer->async_wait(boost::bind(&SMSNetworkPlugin::handleSMSDir, this)); } diff --git a/plugin/cpp/BoostNetworkPlugin.cpp b/plugin/cpp/BoostNetworkPlugin.cpp index 28ad965b..9fbf53b9 100644 --- a/plugin/cpp/BoostNetworkPlugin.cpp +++ b/plugin/cpp/BoostNetworkPlugin.cpp @@ -31,7 +31,7 @@ BoostNetworkPlugin::BoostNetworkPlugin(Config *config, const std::string &host, : NetworkPlugin(), io_context() { this->config = config; LOG4CXX_INFO(pluginLogger, "Starting the plugin."); - boost::asio::ip::tcp::endpoint ep(boost::asio::ip::address::from_string(host), port); + boost::asio::ip::tcp::endpoint ep(boost::asio::ip::make_address(host), port); socket_ = std::make_shared(io_context); socket_->async_connect(ep, [this, host](boost::system::error_code ec) { if (!ec) {