7 #include <net/socket.h>
28 std::vector<std::shared_ptr<Net::Socket>>
_clients;
45 std::vector<std::shared_ptr<Net::Socket>>
GetClients();
A base class representing a network socket.
std::vector< std::shared_ptr< Net::Socket > > GetClients()
Get the vector of client sockets connected to this server.
void Close()
Close the server and stop listening for incoming connections.
void onClientConnect(const Net::Socket &client) const
Called when a client connects to the server.
std::vector< std::shared_ptr< Net::Socket > > _clients
Server(Server::Type type)
Constructor for the Server class.
void UDPListen()
Start listening for incoming UDP packets on the server.
Type
Enum defining the types of servers.
void onClientDisconnect(const Net::Socket &client)
Called when a client disconnects from the server.
void DisconnectAllClients()
Disconnect all connected clients from the server.
void onServerListen() const
Called when the server starts listening for incoming connections.
void onServerShutdown() const
Called when the server is shutting down.
void Listen()
Start listening for incoming connections on the server.