Files
VoidNet/include/HLAPI/TcpServer.hpp
TheDoctor c50d40341f Update
Removed Message Queue
Sending and receiving is now in one thread (gotta make them separate)
Created a very crude Plugin System
Renamed AllAndMe to AllAndServer
2019-10-15 16:27:16 +01:00

31 lines
510 B
C++

#pragma once
#include <atomic>
#include "VoidNet/TcpListener.hpp"
namespace std::net
{
class Server;
class TcpConnectionHandler;
class TcpServer
{
friend class std::net::Server;
public:
TcpServer(uint32_t max_connections, uint16_t port = DEFAULT_SERVER_PORT);
void Start();
void Stop();
private:
std::shared_ptr<TcpListener> listener;
uint32_t m_maxConnections;
uint16_t m_port;
std::atomic_bool m_run;
std::shared_ptr<std::net::TcpConnectionHandler> m_connectionHandler;
};
}