From 0907d3373c0e4a06863bb2f70eb133a71a495549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Wed, 29 Nov 2023 11:55:52 +0100 Subject: [PATCH] implement subscribe in STOMP --- main.cpp | 6 ++++++ stomp.cpp | 13 +++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/main.cpp b/main.cpp index d351f99..8f49b72 100644 --- a/main.cpp +++ b/main.cpp @@ -26,5 +26,11 @@ int main(int argc, char *argv[]) { {"login", "sdi10"}, {"passcode", "809c02f36becb0868da98761fe3209f6"} }).send(socket); + + + + STOMPFrame(STOMPFrame::MESSAGE, { + {}, + }).send(socket); return application.exec(); } diff --git a/stomp.cpp b/stomp.cpp index 2f947fb..f5900d3 100644 --- a/stomp.cpp +++ b/stomp.cpp @@ -4,13 +4,14 @@ Stomp::Stomp() { } -bool Stomp::subscribe(interface::iStompObserver obs) { +bool Stomp::subscribe(interface::iStompObserver* obs) { for(int i = 0; i < MAX_OBSERVER; i++) { - if (observer_[i] == nullptr) { - observer_[i] = obs; - return true; - } + if (observer_[i] == nullptr) { + observer_[i] = obs; + return true; } - return false; + } + return false; +}