JDK-8238770 : Add protocol specific factory creation methods to SocketChannel and ServerSocketChannel
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.nio
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2020-02-10
  • Updated: 2023-10-23
  • Resolved: 2020-03-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 15
15Resolved
Related Reports
Duplicate :  
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
Comments
Duplicate of JDK-8241305
20-03-2020

Using JDK-8238770-branch in sandbox
11-02-2020