mikage-dev/source/utility/simple_tcp.hpp
2024-03-08 10:54:13 +01:00

19 lines
369 B
C++

#pragma once
#include <boost/asio/ip/tcp.hpp>
class SimpleTCPServer {
protected:
boost::asio::io_context io_context;
boost::asio::ip::tcp::acceptor acceptor;
void SetupAsyncAccept();
public:
SimpleTCPServer(uint16_t port);
virtual void OnClientConnected(boost::asio::ip::tcp::socket) = 0;
void RunTCPServer();
void StopTCPServer();
};