diff --git a/lesson_04/server/tcp_server.cpp b/lesson_04/server/tcp_server.cpp index 0b26b9a..db90e6c 100644 --- a/lesson_04/server/tcp_server.cpp +++ b/lesson_04/server/tcp_server.cpp @@ -18,11 +18,6 @@ namespace azh { } - TCPServer::~TCPServer() - { - - } - int TCPServer::run() { try @@ -52,4 +47,19 @@ namespace azh startAccept(); }); } + + template + void writeToConnection(int connectionIndex, const T& message) + { + + } + + template + using listenCallback = std::function; + + template + void registerListenCallback(int connectionIndex, listenCallback callback) + { + + } } diff --git a/lesson_04/server/tcp_server.hpp b/lesson_04/server/tcp_server.hpp index aa400a1..9d29a60 100644 --- a/lesson_04/server/tcp_server.hpp +++ b/lesson_04/server/tcp_server.hpp @@ -10,6 +10,7 @@ #include #include #include +#include namespace azh { @@ -22,8 +23,17 @@ namespace azh { public: TCPServer(IPV ipv, int port); - virtual ~TCPServer(); + int run(); + + template + void writeToConnection(int connectionIndex, const T& message); + + template + using listenCallback = std::function; + + template + void registerListenCallback(int connectionIndex, listenCallback callback); private: IPV _ipVersion; int _port;