Methods Summary |
---|
public abstract java.nio.channels.SocketChannel | accept()Accepts a connection to this server-socket channel.
This method returns {@code null} when this channel is non-blocking and no
connection is available, otherwise it blocks until a new connection is
available or an I/O error occurs. The socket channel returned by this
method will always be in blocking mode.
This method just executes the same security checks as the {@code
accept()} method of the {@link ServerSocket} class.
|
public static java.nio.channels.ServerSocketChannel | open()Creates an open and unbound server-socket channel.
This channel is created by calling {@code openServerSocketChannel} method
of the default {@code SelectorProvider} instance.
return SelectorProvider.provider().openServerSocketChannel();
|
public abstract java.net.ServerSocket | socket()Return the server-socket assigned this channel, which does not declare
any public methods that are not declared in {@code ServerSocket}.
|
public final int | validOps()Gets the valid operations of this channel. Server-socket channels support
accepting operation, so this method returns {@code
SelectionKey.OP_ACCEPT}.
return SelectionKey.OP_ACCEPT;
|