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

Add protocol specific factory creation methods to SocketChannel and ServerSocketChannel

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • 15
    • None
    • core-libs
    • None

      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

            michaelm Michael McMahon
            michaelm Michael McMahon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: