From b5fc2106912f0ed3168972caee33b45ee6bb4b53 Mon Sep 17 00:00:00 2001 From: Angelo Mantellini Date: Fri, 22 Mar 2019 11:04:20 +0100 Subject: [HICN-8] Update viper video player to use hicn sockets over HTTP Change-Id: I0aa727e513e3ffcf3286cecc7e7c43237da5155f Signed-off-by: Angelo Mantellini --- Websocket/communication-protocol.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'Websocket/communication-protocol.cpp') diff --git a/Websocket/communication-protocol.cpp b/Websocket/communication-protocol.cpp index 99bcfa90..3e5f979c 100644 --- a/Websocket/communication-protocol.cpp +++ b/Websocket/communication-protocol.cpp @@ -16,7 +16,6 @@ #include "websocket-server.h" #include "communication-protocol.h" - /////////////////// //Explanation: A query can select/update 2 objects: // - Coordinates of a node @@ -34,7 +33,7 @@ std::set ProtocolDetails::AllowedObjectName = {"stats"}; std::set ProtocolDetails::AllowedActions = { "select", "subscribe"}; std::set ProtocolDetails::AllowedFields = {"quality", "rate", "all"}; -std::function CommunicationProtocol::timerCallback; +std::function CommunicationProtocol::timerCallback; CommunicationProtocol::CommunicationProtocol(ProtocolVersion version) : version(version) @@ -150,10 +149,10 @@ CommunicationProtocol::processQuery(Server *s, websocketpp::connection_hdl hdl, } else if (action == *ProtocolDetails::AllowedActions.find("subscribe")) { - subscribeTimer = std::shared_ptr(new boost::asio::deadline_timer(s->get_io_service(), - boost::posix_time::milliseconds(1000))); + subscribeTimer = std::shared_ptr(new asio::steady_timer(s->get_io_service(), + std::chrono::milliseconds(1000))); timerCallback = [this, s, hdl, msg, query] - (const boost::system::error_code &ec) { + (const std::error_code &ec) { if (!ec) { Query reply = this->makeReplyQuery(query); @@ -171,7 +170,7 @@ CommunicationProtocol::processQuery(Server *s, websocketpp::connection_hdl hdl, return; } - subscribeTimer->expires_from_now(boost::posix_time::milliseconds(1000)); + subscribeTimer->expires_from_now(std::chrono::milliseconds(1000)); subscribeTimer->async_wait(timerCallback); } }; -- cgit 1.2.3-korg