mirror of
https://github.com/mikage-emu/mikage-dev.git
synced 2025-01-09 06:50:59 +01:00
19 lines
369 B
C++
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();
|
|
};
|