move TIoPollThread out and use it in TServer

the previous IoCtx was never being polled
This commit is contained in:
Lion Kortlepel
2026-04-09 18:49:10 +02:00
parent be0d8d5334
commit c08eefdf69
6 changed files with 105 additions and 68 deletions
-15
View File
@@ -23,24 +23,10 @@
#include "TConnectionLimiter.h"
#include "TResourceManager.h"
#include "TServer.h"
#include <boost/asio/io_context.hpp>
#include <boost/asio/ip/udp.hpp>
struct TConnection;
class TIoPollThread {
public:
TIoPollThread();
~TIoPollThread();
boost::asio::io_context& IoCtx() noexcept { return mIoCtx; }
private:
boost::asio::io_context mIoCtx;
boost::asio::executor_work_guard<boost::asio::io_context::executor_type> mWorkGuard;
std::jthread mThread;
};
class TNetwork {
public:
TNetwork(TServer& Server, TPPSMonitor& PPSMonitor, TResourceManager& ResourceManager);
@@ -76,7 +62,6 @@ private:
std::thread mUDPThread;
std::thread mTCPThread;
std::mutex mOpenIDMutex;
TIoPollThread mIoCtxPoller;
TConnectionLimiter mConnectionLimiter;
std::vector<uint8_t> UDPRcvFromClient(boost::asio::ip::udp::endpoint& ClientEndpoint);