New version

This commit is contained in:
TheDoctor
2019-10-12 18:04:36 +01:00
parent b88bed3bd0
commit 6db271bd7e
64 changed files with 2972 additions and 2222 deletions

32
include/TcpListener.hpp Normal file
View File

@ -0,0 +1,32 @@
#pragma once
#include <thread>
#include <queue>
#include "Socket.hpp"
namespace std::net
{
class TcpConnectionHandler;
}
namespace std::net
{
class TcpClient;
class TcpListener
{
friend class std::net::TcpConnectionHandler;
public:
TcpListener(uint16_t port, std::chrono::milliseconds inSleepTime = std::chrono::milliseconds(1));
TcpListener(Socket *InSocket, std::chrono::milliseconds inSleepTime = std::chrono::milliseconds(1));
TcpClient *AcceptClient();
private:
std::chrono::milliseconds m_sleepTime;
std::unique_ptr<Socket> m_socket;
uint16_t m_port = 0;
};
}