DatagramSocket and MulticastSocket constructors don't specify how a null InetAddress is handled

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P3
    • 15
    • Affects Version/s: 15
    • Component/s: core-libs
    • b27

      The constructor:
          public DatagramSocket(int port, InetAddress laddr) throws SocketException {
              this(new InetSocketAddress(laddr, port));
          }

      relies on `InetSocketAddress(laddr, port)` whose specification states "A null address will assign the wildcard address". A similar assertion should be added to the specification of `DatagramSocket(int port, InetAddress laddr)` to clarify what occurs when a null address is passed as a parameter. This is also true for `MulticastSocket(SocketAddress bindaddr)`.

      The constructor:
          public DatagramSocket(int port) throws SocketException {
              this(port, null);
          }

      mentions "The socket will be bound to the wildcard address, an IP address chosen by the kernel". This is ambiguous and requires clarification.

            Assignee:
            Patrick Concannon (Inactive)
            Reporter:
            Dmitry Bessonov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: