3#include <StormByte/network/endpoint.hxx>
8#include <unordered_map>
97 bool Connect(const
Connection::Protocol& protocol, const std::
string& address, const
unsigned short& port) override;
102 void Disconnect() noexcept override;
110 return m_status.load();
122 std::unique_ptr<Socket::Server> m_socket_server;
123 std::atomic<Connection::Status> m_status;
124 std::thread m_accept_thread;
125 std::unordered_map<std::string, std::shared_ptr<Connection::Client>> m_clients;
126 std::unordered_map<std::string, std::thread> m_handle_msg_threads;
132 void AcceptClients() noexcept;
139 void HandleClientCommunication(const std::
string& client_uuid) noexcept;
Abstract base for network endpoints (clients/servers).
Definition endpoint.hxx:26
Abstract base for application-specific servers.
Definition server.hxx:49
Server(const DeserializePacketFunction &deserialize_packet_function, std::shared_ptr< Logger::Log > logger) noexcept
Constructs a Server instance.
Server(Server &&other) noexcept=default
Move constructor.
void DisconnectClient(const std::string &uuid) noexcept
Disconnects a client by UUID.
virtual ~Server() noexcept
Virtual destructor.
Server(const Server &other)=delete
Copy constructor (deleted).
The namespace containing connection items.
Network-related classes used by the StormByte networking subsystem.
std::function< PacketPointer(Transport::Packet::OpcodeType, Buffer::Consumer, std::shared_ptr< Logger::Log >)> DeserializePacketFunction
The deserialize packet function type.
Definition typedefs.hxx:43
std::shared_ptr< Transport::Packet > PacketPointer
The packet pointer type.
Definition typedefs.hxx:38