Commit bb0b518e authored by Luca Boccassi's avatar Luca Boccassi

Problem: ZMQ_BINDTODEVICE not used for ZMQ_DISH

Solution: apply the option outside of the send/recv_enabled blocks so
that it is used for all types of UDP sockets
parent 415bdbc1
......@@ -101,6 +101,10 @@ void zmq::udp_engine_t::plug (io_thread_t* io_thread_, session_base_t *session_)
io_object_t::plug (io_thread_);
handle = add_fd (fd);
// Bind the socket to a device if applicable
if (!options.bound_device.empty ())
bind_to_device (fd, options.bound_device);
if (send_enabled) {
if (!options.raw_socket) {
out_address = address->resolved.udp_addr->dest_addr ();
......@@ -123,10 +127,6 @@ void zmq::udp_engine_t::plug (io_thread_t* io_thread_, session_base_t *session_)
errno_assert (rc == 0);
#endif
// Bind the socket to a device if applicable
if (!options.bound_device.empty ())
bind_to_device (fd, options.bound_device);
rc = bind (fd, address->resolved.udp_addr->bind_addr (),
address->resolved.udp_addr->bind_addrlen ());
#ifdef ZMQ_HAVE_WINDOWS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment