FIX: fixed some issues with subscribung and unsubscribing from topics

This commit is contained in:
Henry Winkel
2023-01-18 11:21:57 +01:00
parent f7d57ccbb8
commit 49bdb28535
7 changed files with 83 additions and 40 deletions

View File

@@ -51,7 +51,6 @@ namespace WHISPER {
std::list<std::shared_ptr<localClient>> localclients;
std::atomic<bool> stopReceiving = false;
/**
@@ -76,7 +75,7 @@ namespace WHISPER {
public:
InternalUDPService(std::uint32_t id, SourceType owndevicetype,std::uint16_t port, std::string destinationAdress, std::string myAdress);
~InternalUDPService();

View File

@@ -39,8 +39,6 @@ namespace WHISPER
std::uint32_t ownID_;
/// device Type
SourceType ownDeviceType_;
/// all topics this service subscribed
std::vector<std::string> subscribedTopics;
/// show if the service is connected or not
std::atomic<bool> connected;
@@ -56,7 +54,8 @@ namespace WHISPER
std::shared_ptr<threadSafeQueue<WHISPER::Message>> receiveQueue = nullptr;
std::atomic<bool> Connected = false;
void receive();
@@ -75,13 +74,17 @@ namespace WHISPER
protected:
/// all topics this service subscribed
std::vector<std::string> subscribedTopics;
void addMsgToReceiverQueue(WHISPER::Message);
void setGateway(bool);
bool isGateway();
void setConnected(bool val);
bool isConnected();
virtual void derivedConnect() = 0;
virtual void derivedDisconnect() = 0;