diff options
Diffstat (limited to 'src/blu_cat/net/server/server.hpp')
-rw-r--r-- | src/blu_cat/net/server/server.hpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/blu_cat/net/server/server.hpp b/src/blu_cat/net/server/server.hpp index 271d75a..00b277f 100644 --- a/src/blu_cat/net/server/server.hpp +++ b/src/blu_cat/net/server/server.hpp @@ -17,9 +17,10 @@ #ifndef BLU_CAT_SERVER_SERVER_H #define BLU_CAT_SERVER_SERVER_H 1 +#include <queue> + #include "../common/connection.hpp" #include "../common/connection_callback.hpp" -#include "../common/tsqueue.hpp" namespace BluCat::NET { @@ -30,9 +31,9 @@ class Server: public ConnectionCallback asio::io_context io_context; std::thread thread_context; asio::ip::tcp::acceptor acceptor; - MessageCallback *(*callback_instantiator)(); + void (*get_new_connection)(std::unique_ptr<Connection> c); - TSQueue<unsigned long> free_connection_slots; + std::queue<unsigned long> free_connection_slots; std::vector<Connection*> connections; void @@ -40,12 +41,10 @@ class Server: public ConnectionCallback public: void - read_messages(); - - void - end_connection(unsigned long index); + disconnect(unsigned long index); - Server(MessageCallback *(*callback_instantiator)(), const uint16_t port); + Server(void (*get_new_connection)(std::unique_ptr<Connection> c), + const uint16_t port); ~Server(); }; |