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