Add protocol specific factory creation methods to SocketChannel and ServerSocketChannel

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Fixed
    • Priority: P4
    • 15
    • Affects Version/s: None
    • Component/s: core-libs
    • None
    • b24

      We need static factory creation methods on java.nio.channels.SocketChannel and java.nio.channels.ServerSocketChannel which take a ProtocolFamily

      public class SocketChannel {
          public static SocketChannel open(ProtocolFamily family) throws IOException
      }

      public class ServerSocketChannel {
          public static ServerSocketChannel open(ProtocolFamily family) throws IOException
      }

      together with supporting spi methods in SelectorProvider.

      The behavior should be equivalent to the similar existing method on DatagramChannel, which is to support:

      StandardProtocolFamily.INET => an IPv4 only channel

      StandardProtocolFamily.INET6 => a dual stack IPv4/IPv6 channel on dual stack systems, and an IPv6 only channel on an IPv6 only system

      This will also facilitate the support of Unix domain as another standard protocol family.

      A prototype of this work is available in the JDK sandbox repo in the `JDK-8238770-branch` (note the different bug id).

            Assignee:
            Michael McMahon
            Reporter:
            Michael McMahon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: