tools: fix compilation with Boost 1.67
Change-Id: I0f4bae23f26eca07044990ce6dd01da750cfb569
Refs: #4584
diff --git a/tools/ndnsec/cert-dump.cpp b/tools/ndnsec/cert-dump.cpp
index e0b99b4..39d5baf 100644
--- a/tools/ndnsec/cert-dump.cpp
+++ b/tools/ndnsec/cert-dump.cpp
@@ -22,7 +22,9 @@
#include "ndnsec.hpp"
#include "util.hpp"
+#if BOOST_VERSION < 106700
#include <boost/date_time/posix_time/posix_time_duration.hpp>
+#endif // BOOST_VERSION < 106700
namespace ndn {
namespace ndnsec {
@@ -173,9 +175,12 @@
return 0;
}
if (isRepoOut) {
- using namespace boost::asio::ip;
- tcp::iostream requestStream;
+ boost::asio::ip::tcp::iostream requestStream;
+#if BOOST_VERSION >= 106700
+ requestStream.expires_after(std::chrono::seconds(3));
+#else
requestStream.expires_from_now(boost::posix_time::seconds(3));
+#endif // BOOST_VERSION >= 106700
requestStream.connect(repoHost, repoPort);
if (!requestStream) {
std::cerr << "fail to open the stream!" << std::endl;