Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8238588 JEP 380: Unix-Domain Socket Channels
  3. JDK-8241305

Add protocol specific factory creation methods to SocketChannel and ServerSocketChannel

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Fixed
    • P4
    • 15
    • None
    • core-libs
    • None
    • b24

    Description

      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).

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: