java.nio.channels
Class ServerSocketChannel

java.lang.Object
  extended by java.nio.channels.spi.AbstractInterruptibleChannel
      extended by java.nio.channels.SelectableChannel
          extended by java.nio.channels.spi.AbstractSelectableChannel
              extended by java.nio.channels.ServerSocketChannel
All Implemented Interfaces:
Closeable, Channel, InterruptibleChannel

public abstract class ServerSocketChannel
extends AbstractSelectableChannel

Since:
1.4

Constructor Summary
protected ServerSocketChannel(SelectorProvider provider)
          Initializes this channel.
 
Method Summary
abstract  SocketChannel accept()
          Accepts a connection made to this channel's socket.
static ServerSocketChannel open()
          Opens a server socket channel.
abstract  ServerSocket socket()
          Retrieves the channels socket.
 int validOps()
          Retrieves the valid operations for this channel.
 
Methods inherited from class java.nio.channels.spi.AbstractSelectableChannel
blockingLock, configureBlocking, implCloseChannel, implCloseSelectableChannel, implConfigureBlocking, isBlocking, isRegistered, keyFor, provider, register
 
Methods inherited from class java.nio.channels.SelectableChannel
register
 
Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel
begin, close, end, isOpen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerSocketChannel

protected ServerSocketChannel(SelectorProvider provider)
Initializes this channel.

Method Detail

accept

public abstract SocketChannel accept()
                              throws IOException
Accepts a connection made to this channel's socket.

Throws:
IOException - If an error occurs
AsynchronousCloseException - If another thread closes this channel while the accept operation is in progress.
ClosedByInterruptException - If another thread interrupts the current thread while the accept operation is in progress, thereby closing the channel and setting the current thread's interrupt status.
ClosedChannelException - If the channel is closed.
NotYetBoundException - If the channel's socket is not yet bound.
SecurityException - If a security manager has been installed and it does not permit access to the remote endpoint of the new connection.

socket

public abstract ServerSocket socket()
Retrieves the channels socket.


open

public static ServerSocketChannel open()
                                throws IOException
Opens a server socket channel.

Throws:
IOException - If an error occurs

validOps

public final int validOps()
Retrieves the valid operations for this channel.

Specified by:
validOps in class SelectableChannel