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