< prev index next >
src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java
Print this page
rev 55750 : UDS support, temporary commit
@@ -24,10 +24,11 @@
*/
package java.nio.channels;
import java.io.IOException;
+import java.net.ProtocolFamily;
import java.net.ServerSocket;
import java.net.SocketOption;
import java.net.SocketAddress;
import java.nio.channels.spi.AbstractSelectableChannel;
import java.nio.channels.spi.SelectorProvider;
@@ -112,10 +113,22 @@
public static ServerSocketChannel open() throws IOException {
return SelectorProvider.provider().openServerSocketChannel();
}
/**
+ * Opens a server-socket for the specific address family.
+ *
+ * @see #open()
+ * @param family The protocol family e.g. AF_UNIX
+ * @return A new socket channel
+ * @throws IOException If an I/O error occurs
+ */
+ public static ServerSocketChannel open(ProtocolFamily family) throws IOException {
+ return SelectorProvider.provider().openServerSocketChannel(family);
+ }
+
+ /**
* Returns an operation set identifying this channel's supported
* operations.
*
* <p> Server-socket channels only support the accepting of new
* connections, so this method returns {@link SelectionKey#OP_ACCEPT}.
< prev index next >