FeatherMC/src/network/TCPListener.h

28 lines
518 B
C++

#pragma once
#include "TCPCommon.h"
#include <cstdint>
#include <memory>
namespace Feather::Network
{
class TCPListener
{
public:
TCPListener(uint16_t port, IListenerInterface* callbacks);
~TCPListener();
protected:
friend class TCPClient;
void OnClientConnect(TCPClientHandle&& client);
void OnClientDisconnected(const TCPClient* client);
private:
IListenerInterface* m_callbacks;
std::unique_ptr<TCPSocket> m_socket;
};
}