summaryrefslogtreecommitdiffstats
path: root/src/OSSupport/NetworkSingleton.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-05-20 20:59:46 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-07-26 19:57:48 +0200
commit072fdf348826db6bc75207540c55e8e275227516 (patch)
tree433cf29095b8796dd737790fa0be693b1b836613 /src/OSSupport/NetworkSingleton.h
parent1.14 connection support (diff)
downloadcuberite-SeeBackup.tar
cuberite-SeeBackup.tar.gz
cuberite-SeeBackup.tar.bz2
cuberite-SeeBackup.tar.lz
cuberite-SeeBackup.tar.xz
cuberite-SeeBackup.tar.zst
cuberite-SeeBackup.zip
Diffstat (limited to 'src/OSSupport/NetworkSingleton.h')
-rw-r--r--src/OSSupport/NetworkSingleton.h10
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. */