]> git.localhorst.tv Git - blank.git/blobdiff - src/server/Server.hpp
let the server wait a little more efficiently
[blank.git] / src / server / Server.hpp
index 3bffafc29d2ada80307be32b5cab2269c49a6a65..40905c8ff7943b1fb4824a6b9830d436c2a8dbc0 100644 (file)
@@ -29,6 +29,10 @@ public:
        Server(const Config::Network &, World &, const World::Config &, const WorldSave &);
        ~Server();
 
+       // wait for data to arrive for at most dt milliseconds
+       void Wait(int dt) noexcept;
+       // true if there's data waiting to be handled
+       bool Ready() noexcept;
        void Handle();
 
        void Update(int dt);
@@ -63,6 +67,7 @@ private:
 private:
        UDPsocket serv_sock;
        UDPpacket serv_pack;
+       SDLNet_SocketSet serv_set;
        std::list<ClientConnection> clients;
 
        World &world;