[zeromq-dev] multiple udp sender/receiver on same machine bug fix

Robert Zhang robert at scout-trading.com
Wed Aug 26 22:42:11 CEST 2009


I would like to submit a bug fix for the multiple udp sender/receiver
on same machine issue referenced here:
http://lists.zeromq.org/pipermail/zeromq-dev/2009-August/001116.html

The following patch needs to be applied to the "sender" section as
well, not just receiver. So:
if (receiver) {
  //add patch below
}
else {
  //add patch below
}

Thanks,
Robert

> Hello Robin,
>
> Problem with multiple PGM/UDP listeners on single Linux box has been solved
> in commit  3268fa4adfcc032698f9613ed473b26308849d21.
>
> diff --git a/libzmq/pgm_socket.cpp b/libzmq/pgm_socket.cpp
> index 64e641b..78db77b 100644
> --- a/libzmq/pgm_socket.cpp
> +++ b/libzmq/pgm_socket.cpp
> @@ -177,7 +177,15 @@ void zmq::pgm_socket_t::open_transport (void)
>
>    //  Receiver transport.
>    if (receiver) {
> -
> +
> +        //  When using UDP-encapsulation enables socket address sharing
> via
> +        //  SO_REUSEADDR to allow multiple applications to bind to the
> same
> +        //  UDP port.
> +        if (udp_encapsulation) {
> +            rc = pgm_transport_set_multicast_loop (g_transport, TRUE);
> +            assert (rc == 0);
> +        }
> +
>
> Thanks for your feedback.
>
> malo



More information about the zeromq-dev mailing list