#include "WHISPER/InternalUDPService.hpp" #include "WHISPER/Messages/Message.hpp" #include "zmq.hpp" #include #include #include #include #include /// variable for stopping the application bool running = true; /** * @brief killhandler to set running to false on CTRL-C * * @param s - the signal to manage */ void killHandlerPing(int s) { if (s == SIGINT) { running = false; } } int main() { // GOOGLE_PROTOBUF_VERIFY_VERSION; WHISPER::Join join(1,1,WHISPER::MsgType::JOIN,WHISPER::SourceType::SHIP,8000,"192.168.0.19"); // std::string msg = join.serialize(); // LOG_S(INFO)<<" serialized Message is "<>(); WHISPER::InternalUDPService service(1,WHISPER::SHIP,8000,"192.168.0.255","192.168.0.19"); service.connect(receiver); service.publish(join.serialize(), "management"); service.subscribe("data"); // zmq::context_t ctx(2); // zmq::socket_t sock(ctx,zmq::socket_type::radio); // sock.connect("udp://127.0.0.255:8000"); // std::string string = "hello world form 2"; // zmq::message_t msg(string.begin(),string.end()); // // memcpy (msg.data (), string.data(), string.size()); // LOG_S(INFO)<<"message contains "<size()) { LOG_S(INFO)<<"received messages " << size; size = receiver->size(); } std::this_thread::sleep_for(std::chrono::milliseconds(500)); } return 0; }