<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hi All,</p>
    <p>Please find the latest webrev(<a
href="http://cr.openjdk.java.net/%7Evtewari/8153674/webrev0.1/index.html">http://cr.openjdk.java.net/~vtewari/8153674/webrev0.1/index.html</a>).
      I had removed the SO_REUSEPORT & spec from constructor.</p>
    <p>Thanks,</p>
    <p>Vyom<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On Thursday 29 September 2016 01:38 AM,
      Chris Hegarty wrote:<br>
    </div>
    <blockquote
      cite="mid:2AFB39BF-AB16-4DFA-BAF8-02FE1E84C0FA@oracle.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html; charset=utf-8">
      Thank you Lucy,
      <div class=""><br class="">
      </div>
      <div class="">We’ll proceed with removing the setting of
        SO_REUSEPORT from the</div>
      <div class="">MulticastSocket constructor and spec.</div>
      <div class=""><br class="">
      </div>
      <div class="">-Chris.</div>
      <div class=""><br class="">
        <div>
          <blockquote type="cite" class="">
            <div class="">On 28 Sep 2016, at 20:02, Lu, Yingqi <<a
                moz-do-not-send="true" href="mailto:yingqi.lu@intel.com"
                class="">yingqi.lu@intel.com</a>> wrote:</div>
            <br class="Apple-interchange-newline">
            <div class="">
              <div class="WordSection1">
                <div class=""><span class="">Hi Vyom,</span></div>
                <div class=""><span class=""> </span></div>
                <div class=""><span class="">Thank you very much
                    checking with us.</span></div>
                <div class=""><span class=""> </span></div>
                <div class=""><span class="">We agree that SO_RESUEADDR
                    and SO_REUSEPORT behave the same way for
                    MulticastSocket. There is no need to check and
                    enable SO_REUSEPORT for this particular type of
                    socket. SO_REUSEADDR is sufficient.</span></div>
                <div class=""><span class=""> </span></div>
                <div class=""><span class="">Thanks,</span></div>
                <div class=""><span class="">Lucy</span></div>
                <div class=""><span class=""> </span></div>
                <div class="">
                  <div class="">
                    <div class=""><a moz-do-not-send="true"
                        name="_____replyseparator" class=""></a><b
                        class=""><span class="">From:</span></b><span
                        class=""><span class="Apple-converted-space"> </span>Vyom
                        Tewari [<a moz-do-not-send="true"
                          href="mailto:vyom.tewari@oracle.com" class="">mailto:vyom.tewari@oracle.com</a>]<span
                          class="Apple-converted-space"> </span><br
                          class="">
                        <b class="">Sent:</b><span
                          class="Apple-converted-space"> </span>Wednesday,
                        September 28, 2016 1:26 AM<br class="">
                        <b class="">To:</b><span
                          class="Apple-converted-space"> </span>Chris
                        Hegarty <<a moz-do-not-send="true"
                          href="mailto:chris.hegarty@oracle.com"
                          class="">chris.hegarty@oracle.com</a>>;
                        Mark Sheppard <<a moz-do-not-send="true"
                          href="mailto:mark.sheppard@oracle.com"
                          class="">mark.sheppard@oracle.com</a>>;
                        net-dev <<a moz-do-not-send="true"
                          href="mailto:net-dev@openjdk.java.net"
                          class="">net-dev@openjdk.java.net</a>>;
                        Kaczmarek, Eric <<a moz-do-not-send="true"
                          href="mailto:eric.kaczmarek@intel.com"
                          class="">eric.kaczmarek@intel.com</a>>;
                        Viswanathan, Sandhya <<a
                          moz-do-not-send="true"
                          href="mailto:sandhya.viswanathan@intel.com"
                          class="">sandhya.viswanathan@intel.com</a>>;
                        Kharbas, Kishor <<a moz-do-not-send="true"
                          href="mailto:kishor.kharbas@intel.com"
                          class="">kishor.kharbas@intel.com</a>>;
                        Aundhe, Shirish <<a moz-do-not-send="true"
                          href="mailto:shirish.aundhe@intel.com"
                          class="">shirish.aundhe@intel.com</a>>; Lu,
                        Yingqi <<a moz-do-not-send="true"
                          href="mailto:yingqi.lu@intel.com" class="">yingqi.lu@intel.com</a>><br
                          class="">
                        <b class="">Subject:</b><span
                          class="Apple-converted-space"> </span>Re: RFR
                        8153674: Expected SocketException not thrown
                        when calling bind() with setReuseAddress(false)</span></div>
                  </div>
                </div>
                <div class=""> </div>
                <p class="">Hi All,</p>
                <p class="">I had off line discussion here at Oracle and
                  we decided  not to override getReuseAddr/setReuseAddr
                  for MulticastSocket. If user wants, he can set the
                  SO_REUSEPORT with "setOption"<span class="new"><span
                      class="Apple-converted-space"> </span>before bind.</span></p>
                <p class=""><span class="new">For MulticastSocket<span
                      class="Apple-converted-space"> </span></span>SO_REUSEADDR&SO_REUSEPORT
                  are semantically equivalent which means either option
                  will be sufficient to indicate that the
                  address&port is reusable. So setting SO_REUSEPORT
                  in constructor is really necessary/required ?</p>
                <p class=""><span class="new">I am looking some comments
                    on this from Intel people(they are in mail chain)
                    who did this original change, before we decide how
                    we wants to proceed on this issue.</span></p>
                <p class=""><span class="new">Thanks,</span></p>
                <p class=""><span class="new">Vyom</span></p>
                <div class=""> </div>
                <div class="">
                  <div class="">On Wednesday 14 September 2016 08:47 PM,
                    Chris Hegarty wrote:</div>
                </div>
                <blockquote class="">
                  <div class="">On 14/09/16 15:53, Mark Sheppard wrote:<span
                      class="Apple-converted-space"> </span><br class="">
                    <br class="">
                  </div>
                  <blockquote class="">
                    <div class=""><br class="">
                      that's true wrt SO_REUSEPORT in MulticastSocket
                      constructor. But the<span
                        class="Apple-converted-space"> </span><br
                        class="">
                      same could have been argued for the original<span
                        class="Apple-converted-space"> </span><br
                        class="">
                      invocation of setReuseAddress, by default , in the
                      constructors, which<span
                        class="Apple-converted-space"> </span><br
                        class="">
                      is encapsulating, what pereceived as, common or
                      defacto<span class="Apple-converted-space"> </span><br
                        class="">
                      practice wrt applying SO_REUSEADDR on mcast
                      sockets at the system level.<span
                        class="Apple-converted-space"> </span><br
                        class="">
                      As I understand it, it is generally perceived that
                      SO_REUSEADDR and<span
                        class="Apple-converted-space"> </span><br
                        class="">
                      SO_REUSEPORT are semantically equivalent for
                      multicast sockets.<span
                        class="Apple-converted-space"> </span><br
                        class="">
                      As such, I think in the case of MulticastSocket,
                      the fact that the<span
                        class="Apple-converted-space"> </span><br
                        class="">
                      setRuseAddress() is called in the constructor, it
                      is appropriate<span class="Apple-converted-space"> </span><br
                        class="">
                      to set SO_REUSEPORT also when it exists in the OS.<span
                        class="Apple-converted-space"> </span><br
                        class="">
                      <br class="">
                      I take your point on the semantics of
                      setReuseAddress in DatagramSocket<span
                        class="Apple-converted-space"> </span><br
                        class="">
                      as per its spec. The spec does allude to
                      MulticastSocket.<span
                        class="Apple-converted-space"> </span><br
                        class="">
                      As such, the current proposal's changes just lack
                      the appropriate<span class="Apple-converted-space"> </span><br
                        class="">
                      javadoc to describe its behavior, and its
                      additional functionality of<span
                        class="Apple-converted-space"> </span><br
                        class="">
                      setting SO_REUSEPORT.<span
                        class="Apple-converted-space"> </span><br
                        class="">
                      It is not necessary that overridden method should
                      mirror the semantics<span
                        class="Apple-converted-space"> </span><br
                        class="">
                      of the base class method.<span
                        class="Apple-converted-space"> </span><br
                        class="">
                      If it is accepted that it is generally perceived
                      that SO_REUSEADDR and<span
                        class="Apple-converted-space"> </span><br
                        class="">
                      SO_REUSEPORT are semantically equivalent for
                      multicast sockets,<span
                        class="Apple-converted-space"> </span><br
                        class="">
                      then it seems appropriate that an overriding
                      setReuseAddress(..) method<span
                        class="Apple-converted-space"> </span><br
                        class="">
                      in MulticastSocket can reflect this.<span
                        class="Apple-converted-space"> </span></div>
                  </blockquote>
                  <div class=""><br class="">
                    That sounds reasonable.<span
                      class="Apple-converted-space"> </span><br class="">
                    <br class="">
                    -Chris.<span class="Apple-converted-space"> </span><br
                      class="">
                    <br class="">
                    <br class="">
                  </div>
                  <blockquote class="">
                    <div class="">regards<span
                        class="Apple-converted-space"> </span><br
                        class="">
                      Mark<span class="Apple-converted-space"> </span><br
                        class="">
                      <br class="">
                      <br class="">
                      <br class="">
                      On 14/09/2016 14:58, Chris Hegarty wrote:<span
                        class="Apple-converted-space"> </span><br
                        class="">
                      <br class="">
                    </div>
                    <blockquote class="">
                      <div class="">One additional remark.<span
                          class="Apple-converted-space"> </span><br
                          class="">
                        <br class="">
                        Was it appropriate to update the legacy MC
                        constructors<span class="Apple-converted-space"> </span><br
                          class="">
                        to set the new JDK 9 SO_REUSEPORT in the first
                        place?<span class="Apple-converted-space"> </span><br
                          class="">
                        This can be achievable, opt-in from new code, by
                        creating<span class="Apple-converted-space"> </span><br
                          class="">
                        an unbound MS, setting the option, then binding.<span
                          class="Apple-converted-space"> </span><br
                          class="">
                        <br class="">
                        -Chris.<span class="Apple-converted-space"> </span><br
                          class="">
                        <br class="">
                        On 14/09/16 14:47, Chris Hegarty wrote:<span
                          class="Apple-converted-space"> </span><br
                          class="">
                        <br class="">
                      </div>
                      <blockquote class="">
                        <div class="">Mark,<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          <br class="">
                          On 14/09/16 14:22, Mark Sheppard wrote:<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          <br class="">
                        </div>
                        <blockquote class="">
                          <div class=""><br class="">
                            Hi Chris,<span class="Apple-converted-space"> </span><br
                              class="">
                                 I don't fully understand your
                            objections to the approach taken.<span
                              class="Apple-converted-space"> </span><br
                              class="">
                            Is there a compatibility issue with the
                            addition of the additional<span
                              class="Apple-converted-space"> </span><br
                              class="">
                            methods to MulticastSocket?<span
                              class="Apple-converted-space"> </span></div>
                        </blockquote>
                        <div class=""><br class="">
                          The concern is with setReuseAddress performing
                          an operation that<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          is not clear from the method specification,
                          e.g. from setReuseAddress()<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          <br class="">
                               * Enable/disable the SO_REUSEADDR socket
                          option.<span class="Apple-converted-space"> </span><br
                            class="">
                          <br class="">
                          This is no longer accurate. The proposed
                          changes would affect<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          SO_REUSEPORT too.<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          <br class="">
                          <br class="">
                        </div>
                        <blockquote class="">
                          <div class="">I don't see
                            Datagram.setReuseAddress(...) handling the
                            SO_REUSEPORT<span
                              class="Apple-converted-space"> </span><br
                              class="">
                            option, this has to be done explicitly via
                            setOption at this level of<span
                              class="Apple-converted-space"> </span><br
                              class="">
                            abstraction.<span
                              class="Apple-converted-space"> </span></div>
                        </blockquote>
                        <div class=""><br class="">
                          Yes, it is a bit odd, but these are legacy
                          classes. I am not opposed<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          to adding a new method for this, or something
                          else. I just want to<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          avoid future issues and confusion when
                          setReuseAddress is called and<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          then it is noticed that, the somewhat
                          orthogonal option, SO_REUSEPORT's<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          value has changed. setReuseAddress's spec is
                          very clear about what it<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          does.<span class="Apple-converted-space"> </span><br
                            class="">
                          <br class="">
                          <br class="">
                        </div>
                        <blockquote class="">
                          <div class="">MulticastSocket is a subclass of
                            DatagramSocket (that in itself is a<span
                              class="Apple-converted-space"> </span><br
                              class="">
                            questionable structuring), and as such<span
                              class="Apple-converted-space"> </span><br
                              class="">
                            has specialized behaviour, and part  of that
                            specialization is the<span
                              class="Apple-converted-space"> </span><br
                              class="">
                            setting of  the setting SO_REUSEADDR and
                            SO_REUSEPORT<span
                              class="Apple-converted-space"> </span><br
                              class="">
                            in its constructors, to enable address reuse
                            semantics, prior to<span
                              class="Apple-converted-space"> </span><br
                              class="">
                            binding<span class="Apple-converted-space"> </span><br
                              class="">
                            an address.<span
                              class="Apple-converted-space"> </span></div>
                        </blockquote>
                        <div class=""><br class="">
                          Understood. Of course, the setting of
                          SO_REUSEPORT is new in 9,<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          hence the problem.<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          <br class="">
                          <br class="">
                        </div>
                        <blockquote class="">
                          <div class="">As part of that specialization,
                            it would seem appropriate that<span
                              class="Apple-converted-space"> </span><br
                              class="">
                            MulticastSocket manipulate the SO_REUSEPORT<span
                              class="Apple-converted-space"> </span><br
                              class="">
                            option in a consistent way. Adding an
                            overridden setReuseAddress(...)<span
                              class="Apple-converted-space"> </span><br
                              class="">
                            method provides that consistency and<span
                              class="Apple-converted-space"> </span><br
                              class="">
                            encapsulates the specialized behaviour.<span
                              class="Apple-converted-space"> </span></div>
                        </blockquote>
                        <div class=""><br class="">
                          I agree with the abstraction, just not that
                          setReuseAddress should<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          be used to achieve it. The name and spec of
                          this method is so<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          tied to SO_REUSEADDR.<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          <br class="">
                          <br class="">
                        </div>
                        <blockquote class="">
                          <div class="">Is alternatively proposal to NOT
                            do anything to MulticastSocket, BUT<span
                              class="Apple-converted-space"> </span><br
                              class="">
                            document clearly how to handle the failing
                            scenario, that an<span
                              class="Apple-converted-space"> </span><br
                              class="">
                            MulticastSocket<span
                              class="Apple-converted-space"> </span><br
                              class="">
                            requires both setReuseAddress() and a
                            setOption call to disable<span
                              class="Apple-converted-space"> </span><br
                              class="">
                            reuseaddress semantics on an unbound
                            MulticastSocket ?<span
                              class="Apple-converted-space"> </span></div>
                        </blockquote>
                        <div class=""><br class="">
                          That is one option, and the option that I was
                          suggesting as a possible<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          alternative.<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          <br class="">
                          <br class="">
                        </div>
                        <blockquote class="">
                          <div class="">This then raises the question of
                            why have a convenience method, such as<span
                              class="Apple-converted-space"> </span><br
                              class="">
                            setReuseAddress() in the first place, when
                            it can be handled<span
                              class="Apple-converted-space"> </span><br
                              class="">
                            adequately via the setOption<span
                              class="Apple-converted-space"> </span></div>
                        </blockquote>
                        <div class=""><br class="">
                          We are moving away from these option specific
                          getter and setter<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          methods, in favor of the more general
                          get/setOption methods, as<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          the latter are more adaptable.<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          <br class="">
                          If setReuseAddress is to operate on more than
                          SO_REUSEADDR, then<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          its spec should be very clear about this.<span
                            class="Apple-converted-space"> </span><br
                            class="">
                          <br class="">
                          -Chris.<span class="Apple-converted-space"> </span><br
                            class="">
                          <br class="">
                          <br class="">
                          <br class="">
                        </div>
                        <blockquote class="">
                          <div class="">regards<span
                              class="Apple-converted-space"> </span><br
                              class="">
                            Mark<span class="Apple-converted-space"> </span><br
                              class="">
                            <br class="">
                            On 14/09/2016 13:34, Chris Hegarty wrote:<span
                              class="Apple-converted-space"> </span><br
                              class="">
                            <br class="">
                          </div>
                          <blockquote class="">
                            <div class="">Mark,<span
                                class="Apple-converted-space"> </span><br
                                class="">
                              <br class="">
                              On 14/09/16 13:23, Mark Sheppard wrote:<span
                                class="Apple-converted-space"> </span><br
                                class="">
                              <br class="">
                            </div>
                            <blockquote class="">
                              <div class=""><br class="">
                                Hi Chris,<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                    so are you accepting that it is
                                correct to add the overridden<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                methods in MulticastSocket and that
                                these need<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                appropriate javadoc ?<span
                                  class="Apple-converted-space"> </span></div>
                            </blockquote>
                            <div class=""><br class="">
                              I think we need these, but they should
                              just call their super<span
                                class="Apple-converted-space"> </span><br
                                class="">
                              equivalents, i.e. no implicit setting of
                              SO_REUSEPORT. They would<span
                                class="Apple-converted-space"> </span><br
                                class="">
                              exist solely as a place to locate
                              guidance, or a note, that one<span
                                class="Apple-converted-space"> </span><br
                                class="">
                              will likely want to set SO_REUSEPORT too.<span
                                class="Apple-converted-space"> </span><br
                                class="">
                              <br class="">
                              <br class="">
                            </div>
                            <blockquote class="">
                              <div class="">or are you advocating
                                pushing the handing of the SO_REUSEPORT
                                into<span class="Apple-converted-space"> </span><br
                                  class="">
                                the<span class="Apple-converted-space"> </span><br
                                  class="">
                                base DatagramSocket class ?<span
                                  class="Apple-converted-space"> </span></div>
                            </blockquote>
                            <div class=""><br class="">
                              It is already there. I am not proposing to
                              change this.<span
                                class="Apple-converted-space"> </span><br
                                class="">
                              <br class="">
                              <br class="">
                            </div>
                            <blockquote class="">
                              <div class="">It is not clear how your
                                code changes fit in the proposed fix
                                i.e.<span class="Apple-converted-space"> </span><br
                                  class="">
                                the<span class="Apple-converted-space"> </span><br
                                  class="">
                                explicit setting of the option to false?<span
                                  class="Apple-converted-space"> </span></div>
                            </blockquote>
                            <div class=""><br class="">
                              My proposal is an alternative. It is not
                              related to the current<span
                                class="Apple-converted-space"> </span><br
                                class="">
                              webrev.<span class="Apple-converted-space"> </span><br
                                class="">
                              <br class="">
                              <br class="">
                            </div>
                            <blockquote class="">
                              <div class="">With the current proposed
                                changes then I think it would be<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                sufficient to<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                invoke setReuseAddress(true) in
                                MulticastSocket constructors<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                rather than<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                <br class="">
                                        // Enable SO_REUSEADDR before
                                binding<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                        setReuseAddress<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                <a moz-do-not-send="true"
href="https://java.se.oracle.com/source/s?defs=setReuseAddress&project=jdk9-dev"
                                  class=""><https://java.se.oracle.com/source/s?defs=setReuseAddress&project=jdk9-dev></a>(*true*);<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                <br class="">
                                <br class="">
                                <br class="">
                                <br class="">
                                        // Enable SO_REUSEPORT if
                                supported before binding<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                        *if* (supportedOptions<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                <a moz-do-not-send="true"
href="https://java.se.oracle.com/source/xref/jdk9-dev/jdk/src/java.base/share/classes/java/net/MulticastSocket.java#supportedOptions"
                                  class=""><https://java.se.oracle.com/source/xref/jdk9-dev/jdk/src/java.base/share/classes/java/net/MulticastSocket.java#supportedOptions></a>().contains<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                <br class="">
                                <br class="">
                                <br class="">
                                <a moz-do-not-send="true"
href="https://java.se.oracle.com/source/s?defs=contains&project=jdk9-dev"
                                  class=""><https://java.se.oracle.com/source/s?defs=contains&project=jdk9-dev></a>(StandardSocketOptions<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                <br class="">
                                <br class="">
                                <br class="">
                                <a moz-do-not-send="true"
href="https://java.se.oracle.com/source/s?defs=StandardSocketOptions&project=jdk9-dev"
                                  class=""><https://java.se.oracle.com/source/s?defs=StandardSocketOptions&project=jdk9-dev></a>.SO_REUSEPORT<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                <br class="">
                                <br class="">
                                <br class="">
                                <a moz-do-not-send="true"
href="https://java.se.oracle.com/source/s?defs=SO_REUSEPORT&project=jdk9-dev"
                                  class=""><https://java.se.oracle.com/source/s?defs=SO_REUSEPORT&project=jdk9-dev></a>))<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                <br class="">
                                <br class="">
                                {<span class="Apple-converted-space"> </span><br
                                  class="">
                                            *this*.setOption<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                <a moz-do-not-send="true"
href="https://java.se.oracle.com/source/s?defs=setOption&project=jdk9-dev"
                                  class=""><https://java.se.oracle.com/source/s?defs=setOption&project=jdk9-dev></a>(StandardSocketOptions<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                <br class="">
                                <br class="">
                                <br class="">
                                <a moz-do-not-send="true"
href="https://java.se.oracle.com/source/s?defs=StandardSocketOptions&project=jdk9-dev"
                                  class=""><https://java.se.oracle.com/source/s?defs=StandardSocketOptions&project=jdk9-dev></a>.SO_REUSEPORT<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                <br class="">
                                <br class="">
                                <br class="">
                                <a moz-do-not-send="true"
href="https://java.se.oracle.com/source/s?defs=SO_REUSEPORT&project=jdk9-dev"
                                  class=""><https://java.se.oracle.com/source/s?defs=SO_REUSEPORT&project=jdk9-dev></a>,<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                <br class="">
                                <br class="">
                                *true*);<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                        }<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                <br class="">
                                <br class="">
                                as the overridden setReuseAddress takes
                                care of SO_REUSEPORT<span
                                  class="Apple-converted-space"> </span></div>
                            </blockquote>
                            <div class=""><br class="">
                              Yes, this is what Vyom has proposed, in
                              the webrev.<span
                                class="Apple-converted-space"> </span><br
                                class="">
                              <br class="">
                              I would like to explore an alternative, so
                              see what it would look<span
                                class="Apple-converted-space"> </span><br
                                class="">
                              like.<span class="Apple-converted-space"> </span><br
                                class="">
                              <br class="">
                              -Chris.<span class="Apple-converted-space"> </span><br
                                class="">
                              <br class="">
                              <br class="">
                              <br class="">
                            </div>
                            <blockquote class="">
                              <div class="">regards<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                Mark<span class="Apple-converted-space"> </span><br
                                  class="">
                                <br class="">
                                On 14/09/2016 11:43, Chris Hegarty
                                wrote:<span
                                  class="Apple-converted-space"> </span><br
                                  class="">
                                <br class="">
                              </div>
                              <blockquote class="">
                                <div class="">Vyom,<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  <br class="">
                                  On 11/09/16 08:01, Vyom Tewari wrote:<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  <br class="">
                                </div>
                                <blockquote class="">
                                  <div class="">Hi All,<span
                                      class="Apple-converted-space"> </span><br
                                      class="">
                                    <br class="">
                                    Please review the below code change.<span
                                      class="Apple-converted-space"> </span><br
                                      class="">
                                    <br class="">
                                    Bug        :<span
                                      class="Apple-converted-space"> </span><a
                                      moz-do-not-send="true"
                                      href="https://bugs.openjdk.java.net/browse/JDK-8153674"
                                      class="">https://bugs.openjdk.java.net/browse/JDK-8153674</a><span
                                      class="Apple-converted-space"> </span><br
                                      class="">
                                    <br class="">
                                    Webrev  :<span
                                      class="Apple-converted-space"> </span><br
                                      class="">
                                    <a moz-do-not-send="true"
href="http://cr.openjdk.java.net/%7Evtewari/8153674/webrev0.0/index.html"
                                      class="">http://cr.openjdk.java.net/~vtewari/8153674/webrev0.0/index.html</a><span
                                      class="Apple-converted-space"> </span><br
                                      class="">
                                    <a moz-do-not-send="true"
href="http://cr.openjdk.java.net/%7Evtewari/8153674/webrev0.0/index.html"
                                      class=""><http://cr.openjdk.java.net/%7Evtewari/8153674/webrev0.0/index.html></a><br
                                      class="">
                                    <br class="">
                                    <br class="">
                                    This change override the
                                    "get/setReuseAddress"  for
                                    MulticaseSocket<span
                                      class="Apple-converted-space"> </span><br
                                      class="">
                                    and<span
                                      class="Apple-converted-space"> </span><br
                                      class="">
                                    will abstract with both reuse
                                    attributes(SO_REUSEADDR &<span
                                      class="Apple-converted-space"> </span><br
                                      class="">
                                    SO_REUSEPORT).<span
                                      class="Apple-converted-space"> </span></div>
                                </blockquote>
                                <div class=""><br class="">
                                  This issue arises since the changes
                                  for 6432031 "Add support for<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  SO_REUSEPORT" [1], which sets
                                  SO_REUSEPORT on MulticastSocket, if<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  the available. So setting
                                  setReuseAddress(false) alone is no
                                  longer<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  sufficient to disable address/port
                                  reuse, one must also set<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  SO_REUSEPORT to false.<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  <br class="">
                                  I would be really nervous about
                                  changing set/getReuseAddress,<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  without<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  at least updating the javadoc to
                                  indicate that it is now, for MS,<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  operating on two socket options. 
                                  Although, I do have sympathy<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  here since SO_REUSEPORT and
                                  SO_REUSEADDR are almost identical when<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  dealing with multicasting.<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  <br class="">
                                  An alternative, maybe; Since the MS
                                  constructors document that<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  SO_REUSEPORT will be set, where
                                  available, maybe a javadoc note<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  on the set/getReuseAddress methods
                                  would be sufficient, that<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  indicates that
                                  StandardSocketOptions#SO_REUSEPORT may
                                  also need<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  to be set to have the desired effect?<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  <br class="">
                                  If so, then code would have to:<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  <br class="">
                                      setReuseAddress(false);<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  <br class="">
                                      if<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
(supportedOptions().contains(StandardSocketOptions.SO_REUSEPORT))<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
this.setOption(StandardSocketOptions.SO_REUSEPORT, false);<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  <br class="">
                                    , but at least it is explicit.<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  <br class="">
                                  Q: not all MS constructors document
                                  that SO_REUSEPORT is set, but<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  they should, right? This seems to have
                                  slipped past during 6432031<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  [1].<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  <br class="">
                                  -Chris.<span
                                    class="Apple-converted-space"> </span><br
                                    class="">
                                  <br class="">
                                  [1]<span class="Apple-converted-space"> </span><a
                                    moz-do-not-send="true"
                                    href="https://bugs.openjdk.java.net/browse/JDK-6432031"
                                    class="">https://bugs.openjdk.java.net/browse/JDK-6432031</a></div>
                              </blockquote>
                              <div class=""> </div>
                            </blockquote>
                          </blockquote>
                          <div class=""> </div>
                        </blockquote>
                      </blockquote>
                    </blockquote>
                    <div class=""> </div>
                  </blockquote>
                </blockquote>
                <div class=""> </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br class="">
      </div>
    </blockquote>
    <br>
  </body>
</html>