implement subscribe in STOMP
This commit is contained in:
parent
847393cec3
commit
0907d3373c
6
main.cpp
6
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();
|
||||
}
|
||||
|
13
stomp.cpp
13
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;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user