diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/client/web_socket_client.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/client/web_socket_client.hpp b/include/client/web_socket_client.hpp index 0f58749..4e6cb8b 100644 --- a/include/client/web_socket_client.hpp +++ b/include/client/web_socket_client.hpp @@ -1,5 +1,6 @@ #pragma once +#include <functional> #include <string> namespace client @@ -42,6 +43,14 @@ public: virtual std::tuple<std::string, bool> send(std::string message, std::string uri) = 0; /** + * @brief Sets up a message handler for the given server. + * @param uri The URI of the server to which the message handler should be attached. + * @param messageHandler A callable object that will be invoked when the client receives a + * message from the server. + */ + virtual void receive(std::string uri, std::function<void(const std::string&)> messageHandler) = 0; + + /** * @brief Closes the connection to the given server. */ virtual void closeConnection(std::string uri) = 0; |