diff options
author | Michael Jurkoic <mjjurkoic@gmail.com> | 2024-04-10 21:33:45 -0500 |
---|---|---|
committer | Michael Jurkoic <mjjurkoic@gmail.com> | 2024-04-10 21:33:45 -0500 |
commit | c8bb6c8f56e0c6d93c8623722ab932c04de882b5 (patch) | |
tree | b61f055748e8c8058f9d27c1441bf68d3bca030d /include/client/web_socket_client.hpp | |
parent | 0a185a13aa4c202ad8d76ac3e62a878dc5f06619 (diff) |
Handle relay response messages
These changes do not yet have unit tests.
Diffstat (limited to 'include/client/web_socket_client.hpp')
-rw-r--r-- | include/client/web_socket_client.hpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/client/web_socket_client.hpp b/include/client/web_socket_client.hpp index 3ef2b86..6fbede6 100644 --- a/include/client/web_socket_client.hpp +++ b/include/client/web_socket_client.hpp @@ -43,6 +43,19 @@ public: virtual std::tuple<std::string, bool> send(std::string message, std::string uri) = 0; /** + * @brief Sends the given message to the given server and sets up a message handler for + * messages received from the server. + * @returns A tuple indicating the server URI and whether the message was successfully + * sent. + * @remark Use this method to send a message and set up a message handler for responses in the + * same call. + */ + virtual std::tuple<std::string, bool> send( + std::string message, + std::string uri, + std::function<void(const std::string&)> messageHandler) = 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 with the payload the client |