Re: [Boost-bugs] [Boost C++ Libraries] #13463: Boost UDP multicast sender not using correct port

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #13463: Boost UDP multicast sender not using correct port
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2018-03-04 01:32:37


#13463: Boost UDP multicast sender not using correct port
-------------------------------+---------------------------------------
  Reporter: anonymous | Owner: chris_kohlhoff
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: asio
   Version: Boost 1.66.0 | Severity: Showstopper
Resolution: | Keywords: asio udp multicast sender
-------------------------------+---------------------------------------

Comment (by nguyen.tnhoang@…):

 OK, I manage to narrow down the error, but not sure how it happens. In
 the sender() class constructor:

         sender(boost::asio::io_context& io_context, const
 boost::asio::ip::address& multicast_address)
                 : endpoint_(multicast_address, multicast_port),
                 socket_(io_context, endpoint_.protocol()),
                 timer_(io_context),
                 message_count_(0)

 I change the line:

                 socket_(io_context, endpoint_.protocol()),

 into

                 socket_(io_context, udp::endpoint(udp::v4(), 13000)),

 It works properly. Wireshark shows the packages sent with that specified
 source port of 13000. However, if I change it to:

                 socket_(io_context, udp::endpoint(udp::v4(),
 multicast_port)),

 It still won't work, despite multicast_port being specified as 13000.
 Please help. I need the source port to be dynamically set. Thank you.

-- 
Ticket URL: <https://svn.boost.org/trac10/ticket/13463#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2018-03-04 01:36:34 UTC