diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2020-05-20 20:59:46 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@outlook.com> | 2020-07-26 19:57:48 +0200 |
commit | 072fdf348826db6bc75207540c55e8e275227516 (patch) | |
tree | 433cf29095b8796dd737790fa0be693b1b836613 /src/OSSupport/NetworkSingleton.h | |
parent | 1.14 connection support (diff) | |
download | cuberite-072fdf348826db6bc75207540c55e8e275227516.tar cuberite-072fdf348826db6bc75207540c55e8e275227516.tar.gz cuberite-072fdf348826db6bc75207540c55e8e275227516.tar.bz2 cuberite-072fdf348826db6bc75207540c55e8e275227516.tar.lz cuberite-072fdf348826db6bc75207540c55e8e275227516.tar.xz cuberite-072fdf348826db6bc75207540c55e8e275227516.tar.zst cuberite-072fdf348826db6bc75207540c55e8e275227516.zip |
Diffstat (limited to '')
-rw-r--r-- | src/OSSupport/NetworkSingleton.h | 10 |
1 files changed, 8 insertions, 2 deletions
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 <event2/event.h> +#include <asio/ip/tcp.hpp> +#include <asio/io_context.hpp> #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. */ |