18 lines
283 B
C++
18 lines
283 B
C++
|
|
#pragma once
|
||
|
|
|
||
|
|
#include "aliases.hpp"
|
||
|
|
|
||
|
|
class TcpServerBase
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
TcpServerBase(IoContext &io, unsigned short port);
|
||
|
|
virtual ~TcpServerBase() = default;
|
||
|
|
|
||
|
|
void start();
|
||
|
|
|
||
|
|
protected:
|
||
|
|
virtual void createSession(TcpSocket socket) = 0;
|
||
|
|
|
||
|
|
TcpAcceptor acceptor_;
|
||
|
|
};
|