New version
This commit is contained in:
32
include/TcpListener.hpp
Normal file
32
include/TcpListener.hpp
Normal 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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user