tinyrpc/includes/net/tcp/io_thread.hpp
2024-12-25 19:37:28 +08:00

21 lines
369 B
C++

#pragma once
#include "tcp_connection.hpp"
#include <thread>
#include <unordered_map>
namespace tinyrpc {
class IOThread {
public:
IOThread();
~IOThread();
bool addClient(int fd);
private:
void mainFunc();
private:
std::unordered_map<int, TcpConnection*> m_clients;
std::thread m_thread;
};
}