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

MulticastSockets do not have SO_REUSEADDR set

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • 1.4.0
    • core-libs
    • None
    • beta
    • generic
    • generic

      MulticastSockets no longer get SO_REUSEADDR set prior to bind. As a result, if any existing process is already listening for multicast packets on the same port, MulticastSocket creation fails with a BindException: Address already in use.

      Trivial test program (run 2 copies):

      import java.net.*;

      public class Mcast {
          public static void main(String[] args) throws Exception {
      DatagramSocket s = new MulticastSocket(4160);
      synchronized (s) {
      s.wait();
      }
          }
      }

            jccollet Jean-Christophe Collet (Inactive)
            bscheiflsunw Bob Scheifler (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: