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).
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 `
Attachments
Issue Links
- csr for
-
JDK-8242926 Add protocol specific factory creation methods to SocketChannel and ServerSocketChannel
- Closed
- duplicates
-
JDK-8238770 Add protocol specific factory creation methods to SocketChannel and ServerSocketChannel
- Resolved
- relates to
-
JDK-8247463 java/nio/channels/etc/OpenAndConnect.java fails due to IPv6 not available
- Resolved