mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-13 22:50:19 +02:00
make udp support for radio-dish
This commit is contained in:
@@ -42,6 +42,7 @@
|
||||
#include "pgm_receiver.hpp"
|
||||
#include "address.hpp"
|
||||
#include "norm_engine.hpp"
|
||||
#include "udp_engine.hpp"
|
||||
|
||||
#include "ctx.hpp"
|
||||
#include "req.hpp"
|
||||
@@ -498,7 +499,7 @@ void zmq::session_base_t::reconnect ()
|
||||
// and reestablish later on
|
||||
if (pipe && options.immediate == 1
|
||||
&& addr->protocol != "pgm" && addr->protocol != "epgm"
|
||||
&& addr->protocol != "norm") {
|
||||
&& addr->protocol != "norm" && addr->protocol != "udp") {
|
||||
pipe->hiccup ();
|
||||
pipe->terminate (false);
|
||||
terminating_pipes.insert (pipe);
|
||||
@@ -567,6 +568,32 @@ void zmq::session_base_t::start_connecting (bool wait_)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (addr->protocol == "udp") {
|
||||
zmq_assert (options.type == ZMQ_DISH || options.type == ZMQ_RADIO);
|
||||
|
||||
udp_engine_t* engine = new (std::nothrow) udp_engine_t ();
|
||||
alloc_assert (engine);
|
||||
|
||||
bool recv = false;
|
||||
bool send = false;
|
||||
|
||||
if (options.type == ZMQ_RADIO) {
|
||||
send = true;
|
||||
recv = false;
|
||||
}
|
||||
else if (options.type == ZMQ_DISH) {
|
||||
send = false;
|
||||
recv = true;
|
||||
}
|
||||
|
||||
int rc = engine->init (addr, send, recv);
|
||||
errno_assert (rc == 0);
|
||||
|
||||
send_attach (this, engine);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef ZMQ_HAVE_OPENPGM
|
||||
|
||||
// Both PGM and EPGM transports are using the same infrastructure.
|
||||
|
Reference in New Issue
Block a user