| Modifier and Type | Field and Description |
|---|---|
| private final ServerSocketChannelImpl | |
| private volatile int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Socket | accept()
Overrides java. Listens for a connection to be made to this socket and accepts it. |
| public void | bind(SocketAddress local)
Overrides java. Binds the |
| public void | bind(SocketAddress local, int backlog)
Overrides java. Binds the |
| public void | close()
Overrides java. Implements java. Closes this socket. |
| pack-priv static ServerSocket | |
| public ServerSocketChannel | getChannel()
Overrides java. Returns the unique |
| public InetAddress | getInetAddress()
Overrides java. Returns the local address of this server socket. |
| public int | getLocalPort()
Overrides java. Returns the port number on which this socket is listening. |
| public <T> T | getOption(SocketOption<T> name)
Overrides java. Returns the value of a socket option. |
| public int | getReceiveBufferSize()
Overrides java. Gets the value of the |
| public boolean | |
| public int | |
| public boolean | |
| public boolean | |
| public <T> ServerSocket | setOption(SocketOption<T> name, T value)
Overrides java. Sets the value of a socket option. |
| public void | setReceiveBufferSize(int size)
Overrides java. Sets a default proposed value for the
|
| public void | setReuseAddress(boolean on)
Overrides java. Enable/disable the |
| public void | setSoTimeout(int timeout)
Overrides java. Enable/disable |
| public Set | supportedOptions()
Overrides java. Returns a set of the socket options supported by this server socket. |
| public String | toString()
Overrides java. Returns the implementation address and implementation port of
this socket as a |
| ssc | back to summary |
|---|---|
| private final ServerSocketChannelImpl ssc | |
| timeout | back to summary |
|---|---|
| private volatile int timeout | |
| ServerSocketAdaptor | back to summary |
|---|---|
| private ServerSocketAdaptor(ServerSocketChannelImpl ssc) | |
| accept | back to summary |
|---|---|
| public Socket accept() throws IOException Overrides java. Doc from java. Listens for a connection to be made to this socket and accepts it. The method blocks until a connection is made. This method is interruptible in the following circumstances:
| |
| bind | back to summary |
|---|---|
| public void bind(SocketAddress local) throws IOException Overrides java. Doc from java. Binds the
If the address is
| |
| bind | back to summary |
|---|---|
| public void bind(SocketAddress local, int backlog) throws IOException Overrides java. Doc from java. Binds the
If the address is
The
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this socket.
Any thread currently blocked in If this socket has an associated channel then the channel is closed as well. Once closed, several of the methods defined by this class will throw an exception if invoked on the closed socket.
| |
| create | back to summary |
|---|---|
| pack-priv static ServerSocket create(ServerSocketChannelImpl ssc) | |
| getChannel | back to summary |
|---|---|
| public ServerSocketChannel getChannel() Overrides java. Doc from java. Returns the unique A server socket will have a channel if, and only if, the channel
itself was created via the
| |
| getInetAddress | back to summary |
|---|---|
| public InetAddress getInetAddress() Overrides java. Doc from java. Returns the local address of this server socket.
If the socket was bound prior to being
| |
| getLocalPort | back to summary |
|---|---|
| public int getLocalPort() Overrides java. Doc from java. Returns the port number on which this socket is listening.
If the socket was bound prior to being
| |
| getOption | back to summary |
|---|---|
| public <T> T getOption(SocketOption<T> name) throws IOException Overrides java. Doc from java. Returns the value of a socket option.
| |
| getReceiveBufferSize | back to summary |
|---|---|
| public int getReceiveBufferSize() throws SocketException Overrides java. Doc from java. Gets the value of the Note, the value actually set in the accepted socket is determined by
calling
| |
| getReuseAddress | back to summary |
|---|---|
| public boolean getReuseAddress() throws SocketException Overrides java. Doc from java. Tests if
| |
| getSoTimeout | back to summary |
|---|---|
| public int getSoTimeout() throws SocketException Overrides java. Doc from java. Retrieve setting for
| |
| isBound | back to summary |
|---|---|
| public boolean isBound() Overrides java. Doc from java. Returns the binding state of the ServerSocket.
If the socket was bound prior to being closed,
then this method will continue to return
| |
| isClosed | back to summary |
|---|---|
| public boolean isClosed() Overrides java. Doc from java. Returns the closed state of the ServerSocket.
| |
| setOption | back to summary |
|---|---|
| public <T> ServerSocket setOption(SocketOption<T> name, T value) throws IOException Overrides java. Doc from java. Sets the value of a socket option.
| |
| setReceiveBufferSize | back to summary |
|---|---|
| public void setReceiveBufferSize(int size) throws SocketException Overrides java. Doc from java. Sets a default proposed value for the
The value of
It is possible to change the value subsequently, by calling
Failure to do this will not cause an error, and the buffer size may be set to the requested value but the TCP receive window in sockets accepted from this ServerSocket will be no larger than 64K bytes.
| |
| setReuseAddress | back to summary |
|---|---|
| public void setReuseAddress(boolean on) throws SocketException Overrides java. Doc from java. Enable/disable the
When a TCP connection is closed the connection may remain
in a timeout state for a period of time after the connection
is closed (typically known as the
Enabling
When a
The behaviour when
| |
| setSoTimeout | back to summary |
|---|---|
| public void setSoTimeout(int timeout) throws SocketException Overrides java. Doc from java. Enable/disable
| |
| supportedOptions | back to summary |
|---|---|
| public Set Overrides java. Doc from java. Returns a set of the socket options supported by this server socket. This method will continue to return the set of options even after the socket has been closed.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns the implementation address and implementation port of
this socket as a
| |