#pragma once #include "WHISPER/whisper.hpp" #include #include #include #include #define ZMQ_BUILD_DRAFT_API 1 #include #include namespace WHISPER { struct localClient{ short port; zmq::socket_t clientSocket; }; class InternalUDPService : public whispercomm { private: std::string destinationAdress_; std::string myAdress_; std::uint16_t port_; std::uint16_t ownReceivingPort_; zmq::context_t ctx; zmq::socket_t sender; std::shared_ptr receiver = nullptr; std::shared_ptr loopbackSocket = nullptr; std::vector> localclients; std::uint16_t checkPort(std::uint16_t port); void derivedConnect() override; void derivedDisconnect() override; void derivedPublish(std::string msg,std::string topic) override; void derivedReceive() override; void derivedSubscribe(std::string topic) override; void derivedUnsubscribe(std::string topic) override; public: InternalUDPService(std::uint32_t id, SourceType owndevicetype,std::uint16_t port, std::string destinationAdress, std::string myAdress); }; }