重构MultiplexManager和TCPServer,优化客户端管理和连接逻辑,添加异步读取和错误处理

This commit is contained in:
Ayndpa
2025-11-19 20:25:25 +08:00
parent 1991cc9a5d
commit cd7a035ba8
6 changed files with 116 additions and 56 deletions

View File

@@ -19,6 +19,8 @@ public:
void start();
void stop();
std::shared_ptr<MultiplexManager> getMultiplexManager(HSteamNetConnection conn);
private:
void run();
void pollMessages();
@@ -33,6 +35,7 @@ private:
std::map<HSteamNetConnection, std::shared_ptr<MultiplexManager>> multiplexManagers_;
std::thread thread_;
std::thread io_thread_;
bool running_;
};