first version of InternalUDPService
This commit is contained in:
47
include/WHISPER/InternalUDPService.hpp
Normal file
47
include/WHISPER/InternalUDPService.hpp
Normal file
@@ -0,0 +1,47 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "WHISPER/whisper.hpp"
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
#define ZMQ_BUILD_DRAFT_API 1
|
||||
#include <zmq.hpp>
|
||||
#include <zmq_addon.hpp>
|
||||
|
||||
namespace WHISPER {
|
||||
|
||||
class InternalUDPService : public whispercomm {
|
||||
|
||||
|
||||
private:
|
||||
std::string address_;
|
||||
std::uint16_t port_;
|
||||
std::uint16_t ownReceivingPort_;
|
||||
|
||||
zmq::context_t ctx;
|
||||
zmq::socket_t sender;
|
||||
std::shared_ptr<zmq::socket_t> receiver;
|
||||
|
||||
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 address);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user