| public abstract class java.nio.channels ServerSocketChannel
|
Java SE 6 |
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 java.net.ServerSocket object obtained by
invoking the socket method. It is not possible to create
a channel for an arbitrary, pre-existing server socket, nor is it possible
to specify the 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 open
method of this class. A newly-created server-socket channel is open but not
yet bound. An attempt to invoke the accept method of an
unbound server-socket channel will cause a NotYetBoundException to
be thrown. A server-socket channel can be bound by invoking one of the
bind methods
of an associated server socket.
Server-socket channels are safe for use by multiple concurrent threads.
| version | 1.25, 05/11/17 |
| since | 1.4 |
| Constructors | |
|---|---|
| protected | ServerSocketChannel(SelectorProvider provider) Initializes a new instance of this class. |
| Methods | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| abstract public SocketChannel | accept() throws IOException Details
Accepts a connection made to this channel's socket.
If this channel is in non-blocking mode then this method will immediately return null if there are no pending connections. Otherwise it will block indefinitely until a new connection is available or an I/O error occurs. The socket channel returned by this method, if any, will be in blocking mode regardless of the blocking mode of this channel. This method performs exactly the same security checks as the
| ||||||||||||||
| public static ServerSocketChannel | open() throws IOException Details
Opens a server-socket channel.
The new channel is created by invoking the The new channel's socket is initially unbound; it must be bound to a
specific address via one of its socket's
| ||||||||||||||
| abstract public ServerSocket | socket() Details
Retrieves a server socket associated with this channel.
The returned object will not declare any public methods that are not
declared in the
| ||||||||||||||
| final public int | validOps() Details
Returns an operation set identifying this channel's supported
operations.
Server-socket channels only support the accepting of new
connections, so this method returns
| ||||||||||||||
| About DocWeb · Bundles · Export · Export All | Top 10 · Statistics · Login |
| About Sun · Contact · Privacy · Terms of Use · Trademarks | Java SE 6 · Copyright © 1994-2009 Sun Microsystems, Inc.All rights reserved. Use is subject to license terms |
![]() |
![]() |
|