FeatherMC/src/network/TCPListener.h

39 lines
754 B
C++

#pragma once
#include "Lockable.h"
#include "IListenerInterface.h"
#include <cstdint>
#include <memory>
#include <vector>
namespace Feather::Network
{
class TCPSocket;
class TCPListenerClient;
class TCPClient
{
public:
TCPClient(std::unique_ptr<TCPListenerClient>&& client);
TCPClient(TCPClient&& client);
~TCPClient();
const LockableVector<uint8_t>& GetData() const;
private:
std::unique_ptr<TCPListenerClient> m_client;
};
class TCPListener
{
public:
TCPListener(uint16_t port, IListenerInterface* callbacks);
~TCPListener();
private:
IListenerInterface* m_callbacks;
std::unique_ptr<TCPSocket> m_socket;
};
}