JDK-8241305 : Add protocol specific factory creation methods to SocketChannel and ServerSocketChannel
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.nio
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-03-19
  • Updated: 2023-10-23
  • Resolved: 2020-05-17
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
15 b24Fixed
Related Reports
CSR :  
Duplicate :  
Relates :  
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).
Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/d652d9aaf286 User: michaelm Date: 2020-05-17 20:18:25 +0000
17-05-2020

Duplicate of JDK-8241305
19-03-2020