ADD: added methode for message handling in the directCommsClient and Server
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "zmq.hpp"
|
||||
#include <atomic>
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <sys/types.h>
|
||||
@@ -27,6 +28,9 @@ namespace DirectCommunication
|
||||
void sendMessage(std::string msg);
|
||||
std::string getLatestMessage();
|
||||
|
||||
void registerMessageCallback(std::function<void(std::string)> MessageHandle);
|
||||
|
||||
|
||||
private:
|
||||
ushort port_;
|
||||
std::string serverAddress_;
|
||||
@@ -40,6 +44,8 @@ namespace DirectCommunication
|
||||
|
||||
std::atomic_bool isConnected = true;
|
||||
|
||||
std::function<void(std::string)> MessageHandle_ = nullptr;
|
||||
|
||||
|
||||
WHISPER::threadSafeQueue<std::string> receivedMessages_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user