Using a pub-sub model to send and receive message, the Wireshark can get the PGM package on my subscriber computer, but the subscriber seems to stop at const int nbytes =zmq_msg_recv(msg.handle(), _handle, static_cast(flags));
The code of publisher is
:zmq::socket_t publisher(*ctx, zmq::socket_type::pub); publisher.bind("pgm://224.0.0.1:1682"); std::this_thread::sleep_for(std::chrono::milliseconds(200)); char test[256]={0}; while(1){ publisher.send(zmq::str_buffer(test)); }
The code of subscriber is
:'zmq::socket_t subscriber(*ctx, zmq::socket_type::sub); const char* addr = "pgm://192.168.1.139;224.0.0.1:1682"; subscriber.connect(addr); subscriber.set(zmq::sockopt::subscribe, ""); while(1){ zmq::message_t msg; subscriber.recv(msg); std::cout<<"having received message"<<std::endl;
Using a pub-sub model to send and receive message, the Wireshark can get the PGM package on my subscriber computer, but the subscriber seems to stop at const int nbytes =zmq_msg_recv(msg.handle(), _handle, static_cast(flags));
The code of publisher is :
zmq::socket_t publisher(*ctx, zmq::socket_type::pub); publisher.bind("pgm://224.0.0.1:1682"); std::this_thread::sleep_for(std::chrono::milliseconds(200)); char test[256]={0}; while(1){ publisher.send(zmq::str_buffer(test)); }
The code of subscriber is :'
zmq::socket_t subscriber(*ctx, zmq::socket_type::sub); const char* addr = "pgm://192.168.1.139;224.0.0.1:1682"; subscriber.connect(addr); subscriber.set(zmq::sockopt::subscribe, ""); while(1){ zmq::message_t msg; subscriber.recv(msg); std::cout<<"having received message"<<std::endl;