From 072fdf348826db6bc75207540c55e8e275227516 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Wed, 20 May 2020 19:59:46 +0100 Subject: PoC: C++ ASIO --- src/OSSupport/NetworkSingleton.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/OSSupport/NetworkSingleton.h') diff --git a/src/OSSupport/NetworkSingleton.h b/src/OSSupport/NetworkSingleton.h index 2a2d0cef3..31347f4c1 100644 --- a/src/OSSupport/NetworkSingleton.h +++ b/src/OSSupport/NetworkSingleton.h @@ -14,6 +14,8 @@ #pragma once #include +#include +#include #include "NetworkLookup.h" #include "CriticalSection.h" #include "Event.h" @@ -57,7 +59,7 @@ public: event_base * GetEventBase(void) { return m_EventBase; } /** Returns the thread used to perform hostname and IP lookups */ - cNetworkLookup & GetLookupThread() { return m_LookupThread; } + asio::ip::tcp::resolver & GetLookupThread() { return m_Resolver; } /** Adds the specified link to m_Connections. Used by the underlying link implementation when a new link is created. */ @@ -100,7 +102,11 @@ protected: cEvent m_StartupEvent; /** The thread on which hostname and ip address lookup is performed. */ - cNetworkLookup m_LookupThread; + std::thread m_LookupThread; + + asio::io_context m_Context; + + asio::ip::tcp::resolver m_Resolver; /** Converts LibEvent-generated log events into log messages in MCS log. */ -- cgit v1.2.3