Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7160503

MulticastSocket.setLoopbackMode(true) doesn't disable loopback mode

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 8
    • core-libs
    • x86
    • os_x

      java/net/MulticastSocket/NoLoopbackPackets.java failed on MacOSX with two problems.

      First problem, it throws exception java.net.SocketException: Can't assign requested address, Please refer to CR 7160489 to see detailed description.

      Second problem, MulticastSocket.setLoopbackMode(true) doesn't disable loopback mode, this issue only happened on MacOSX.
      Adding debuging code after line 98, run with jdk 8 promoted build b32 and b33,
       
      try {
                          msock.receive(packet);
                          //debugging
                          System.out.println("receive packet: "+ new String(buf));
                          System.out.println("We should not receive anything from following groups, but we did: "+group);

                          // it is an error if we receive something
                          failedGroups.add(group);
                      } catch (SocketTimeoutException e) {
                          // we expect this
                      }


      Output is:
      receive packet: hello world
      We should not receive anything from following groups, but we did: /224.1.1.1:56770
      receive packet: hello world
      We should not receive anything from following groups, but we did: /224.1.1.2:56770

            tyan Tristan Yan (Inactive)
            amjiang Amanda Jiang (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: