diff options
Diffstat (limited to 'libtransport/src/io_modules/udp')
-rw-r--r-- | libtransport/src/io_modules/udp/CMakeLists.txt | 28 | ||||
-rw-r--r-- | libtransport/src/io_modules/udp/udp_socket_connector.cc | 10 | ||||
-rw-r--r-- | libtransport/src/io_modules/udp/udp_socket_connector.h | 3 |
3 files changed, 13 insertions, 28 deletions
diff --git a/libtransport/src/io_modules/udp/CMakeLists.txt b/libtransport/src/io_modules/udp/CMakeLists.txt index 93518d0a2..b9c19d063 100644 --- a/libtransport/src/io_modules/udp/CMakeLists.txt +++ b/libtransport/src/io_modules/udp/CMakeLists.txt @@ -11,9 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) - - list(APPEND MODULE_HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/hicn_forwarder_module.h ${CMAKE_CURRENT_SOURCE_DIR}/udp_socket_connector.h @@ -24,23 +21,12 @@ list(APPEND MODULE_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/udp_socket_connector.cc ) -# add_executable(hicnlight_module MACOSX_BUNDLE ${MODULE_SOURCE_FILES}) -# target_include_directories(hicnlight_module PRIVATE ${LIBTRANSPORT_INCLUDE_DIRS} ${LIBTRANSPORT_INTERNAL_INCLUDE_DIRS}) -# set_target_properties(hicnlight_module PROPERTIES -# BUNDLE True -# MACOSX_BUNDLE_GUI_IDENTIFIER my.domain.style.identifier.hicnlight_module -# MACOSX_BUNDLE_BUNDLE_NAME hicnlight_module -# MACOSX_BUNDLE_BUNDLE_VERSION "0.1" -# MACOSX_BUNDLE_SHORT_VERSION_STRING "0.1" -# # MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/cmake/customtemplate.plist.in -# ) build_module(hicnlight_module - SHARED - SOURCES ${MODULE_SOURCE_FILES} - DEPENDS ${DEPENDENCIES} - COMPONENT lib${LIBTRANSPORT} - INCLUDE_DIRS ${LIBTRANSPORT_INCLUDE_DIRS} ${LIBTRANSPORT_INTERNAL_INCLUDE_DIRS} - # LIBRARY_ROOT_DIR "vpp_plugins" - DEFINITIONS ${COMPILER_DEFINITIONS} - COMPILE_OPTIONS ${COMPILE_FLAGS} + SHARED + SOURCES ${MODULE_SOURCE_FILES} + DEPENDS ${DEPENDENCIES} + COMPONENT ${LIBTRANSPORT_COMPONENT} + INCLUDE_DIRS ${LIBTRANSPORT_INCLUDE_DIRS} ${LIBTRANSPORT_INTERNAL_INCLUDE_DIRS} + DEFINITIONS ${COMPILER_DEFINITIONS} + COMPILE_OPTIONS ${COMPILE_FLAGS} ) diff --git a/libtransport/src/io_modules/udp/udp_socket_connector.cc b/libtransport/src/io_modules/udp/udp_socket_connector.cc index 456886a54..1412d8c07 100644 --- a/libtransport/src/io_modules/udp/udp_socket_connector.cc +++ b/libtransport/src/io_modules/udp/udp_socket_connector.cc @@ -17,8 +17,8 @@ #include <hicn/transport/portability/win_portability.h> #endif +#include <glog/logging.h> #include <hicn/transport/errors/errors.h> -#include <hicn/transport/utils/log.h> #include <hicn/transport/utils/object_pool.h> #include <io_modules/udp/udp_socket_connector.h> @@ -117,7 +117,7 @@ void UdpSocketConnector::doWrite() { // The connection has been closed by the application. return; } else { - TRANSPORT_LOGE("%d %s", ec.value(), ec.message().c_str()); + LOG(ERROR) << ec.value() << " " << ec.message(); tryReconnect(); } }); @@ -137,7 +137,7 @@ void UdpSocketConnector::doRead() { // The connection has been closed by the application. return; } else { - TRANSPORT_LOGE("%d %s", ec.value(), ec.message().c_str()); + LOG(ERROR) << ec.value() << " " << ec.message(); tryReconnect(); } }); @@ -145,7 +145,7 @@ void UdpSocketConnector::doRead() { void UdpSocketConnector::tryReconnect() { if (state_ == Connector::State::CONNECTED) { - TRANSPORT_LOGE("Connection lost. Trying to reconnect...\n"); + LOG(ERROR) << "Connection lost. Trying to reconnect..."; state_ = Connector::State::CONNECTING; is_reconnection_ = true; io_service_.post([this]() { @@ -201,7 +201,7 @@ void UdpSocketConnector::handleDeadline(const std::error_code &ec) { if (!ec) { io_service_.post([this]() { socket_.close(); - TRANSPORT_LOGE("Error connecting. Is the forwarder running?\n"); + LOG(ERROR) << "Error connecting. Is the forwarder running?"; }); } } diff --git a/libtransport/src/io_modules/udp/udp_socket_connector.h b/libtransport/src/io_modules/udp/udp_socket_connector.h index 8ab08e17a..c483e14aa 100644 --- a/libtransport/src/io_modules/udp/udp_socket_connector.h +++ b/libtransport/src/io_modules/udp/udp_socket_connector.h @@ -16,6 +16,7 @@ #pragma once #include <hicn/transport/config.h> +#include <hicn/transport/core/asio_wrapper.h> #include <hicn/transport/core/connector.h> #include <hicn/transport/core/content_object.h> #include <hicn/transport/core/global_object_pool.h> @@ -24,8 +25,6 @@ #include <hicn/transport/core/packet.h> #include <hicn/transport/utils/branch_prediction.h> -#include <asio.hpp> -#include <asio/steady_timer.hpp> #include <deque> namespace transport { |