A selectable channel for stream-oriented listening sockets.
Server-socket channels are not a complete abstraction of listening
network sockets. Binding and the manipulation of socket options must be
done through an associated {@link java.net.ServerSocket} object obtained by
invoking the {@link #socket() socket} method. It is not possible to create
a channel for an arbitrary, pre-existing server socket, nor is it possible
to specify the {@link java.net.SocketImpl} object to be used by a server
socket associated with a server-socket channel.
A server-socket channel is created by invoking the {@link #open() open}
method of this class. A newly-created server-socket channel is open but not
yet bound. An attempt to invoke the {@link #accept() accept} method of an
unbound server-socket channel will cause a {@link NotYetBoundException} to
be thrown. A server-socket channel can be bound by invoking one of the
{@link java.net.ServerSocket#bind(java.net.SocketAddress,int) bind} methods
of an associated server socket.
Server-socket channels are safe for use by multiple concurrent threads.
|