< prev index next >
src/java.base/share/classes/java/net/ServerSocket.java
Print this page
rev 56290 : 8230648: Replace @exception tag with @throws in java.base
Summary: Minor coding style update of javadoc tag in any file in java.base
Reviewed-by: prappo, lancea
*** 81,91 ****
}
/**
* Creates an unbound server socket.
*
! * @exception IOException IO error when opening the socket.
* @revised 1.4
*/
public ServerSocket() throws IOException {
setImpl();
}
--- 81,91 ----
}
/**
* Creates an unbound server socket.
*
! * @throws IOException IO error when opening the socket.
* @revised 1.4
*/
public ServerSocket() throws IOException {
setImpl();
}
*** 113,127 ****
*
*
* @param port the port number, or {@code 0} to use a port
* number that is automatically allocated.
*
! * @exception IOException if an I/O error occurs when opening the socket.
! * @exception SecurityException
* if a security manager exists and its {@code checkListen}
* method doesn't allow the operation.
! * @exception IllegalArgumentException if the port parameter is outside
* the specified range of valid port values, which is between
* 0 and 65535, inclusive.
*
* @see java.net.SocketImpl
* @see java.net.SocketImplFactory#createSocketImpl()
--- 113,127 ----
*
*
* @param port the port number, or {@code 0} to use a port
* number that is automatically allocated.
*
! * @throws IOException if an I/O error occurs when opening the socket.
! * @throws SecurityException
* if a security manager exists and its {@code checkListen}
* method doesn't allow the operation.
! * @throws IllegalArgumentException if the port parameter is outside
* the specified range of valid port values, which is between
* 0 and 65535, inclusive.
*
* @see java.net.SocketImpl
* @see java.net.SocketImplFactory#createSocketImpl()
*** 166,180 ****
* @param port the port number, or {@code 0} to use a port
* number that is automatically allocated.
* @param backlog requested maximum length of the queue of incoming
* connections.
*
! * @exception IOException if an I/O error occurs when opening the socket.
! * @exception SecurityException
* if a security manager exists and its {@code checkListen}
* method doesn't allow the operation.
! * @exception IllegalArgumentException if the port parameter is outside
* the specified range of valid port values, which is between
* 0 and 65535, inclusive.
*
* @see java.net.SocketImpl
* @see java.net.SocketImplFactory#createSocketImpl()
--- 166,180 ----
* @param port the port number, or {@code 0} to use a port
* number that is automatically allocated.
* @param backlog requested maximum length of the queue of incoming
* connections.
*
! * @throws IOException if an I/O error occurs when opening the socket.
! * @throws SecurityException
* if a security manager exists and its {@code checkListen}
* method doesn't allow the operation.
! * @throws IllegalArgumentException if the port parameter is outside
* the specified range of valid port values, which is between
* 0 and 65535, inclusive.
*
* @see java.net.SocketImpl
* @see java.net.SocketImplFactory#createSocketImpl()
*** 219,229 ****
*
* @throws SecurityException if a security manager exists and
* its {@code checkListen} method doesn't allow the operation.
*
* @throws IOException if an I/O error occurs when opening the socket.
! * @exception IllegalArgumentException if the port parameter is outside
* the specified range of valid port values, which is between
* 0 and 65535, inclusive.
*
* @see SocketOptions
* @see SocketImpl
--- 219,229 ----
*
* @throws SecurityException if a security manager exists and
* its {@code checkListen} method doesn't allow the operation.
*
* @throws IOException if an I/O error occurs when opening the socket.
! * @throws IllegalArgumentException if the port parameter is outside
* the specified range of valid port values, which is between
* 0 and 65535, inclusive.
*
* @see SocketOptions
* @see SocketImpl
*** 472,488 ****
* An instance of this class using a system-default {@code SocketImpl}
* accepts sockets with a {@code SocketImpl} of the same type, regardless
* of the {@linkplain Socket#setSocketImplFactory(SocketImplFactory)
* client socket implementation factory}, if one has been set.
*
! * @exception IOException if an I/O error occurs when waiting for a
* connection.
! * @exception SecurityException if a security manager exists and its
* {@code checkAccept} method doesn't allow the operation.
! * @exception SocketTimeoutException if a timeout was previously set with setSoTimeout and
* the timeout has been reached.
! * @exception java.nio.channels.IllegalBlockingModeException
* if this socket has an associated channel, the channel is in
* non-blocking mode, and there is no connection ready to be
* accepted
*
* @return the new Socket
--- 472,488 ----
* An instance of this class using a system-default {@code SocketImpl}
* accepts sockets with a {@code SocketImpl} of the same type, regardless
* of the {@linkplain Socket#setSocketImplFactory(SocketImplFactory)
* client socket implementation factory}, if one has been set.
*
! * @throws IOException if an I/O error occurs when waiting for a
* connection.
! * @throws SecurityException if a security manager exists and its
* {@code checkAccept} method doesn't allow the operation.
! * @throws SocketTimeoutException if a timeout was previously set with setSoTimeout and
* the timeout has been reached.
! * @throws java.nio.channels.IllegalBlockingModeException
* if this socket has an associated channel, the channel is in
* non-blocking mode, and there is no connection ready to be
* accepted
*
* @return the new Socket
*** 672,682 ****
* a {@link SocketException}.
*
* <p> If this socket has an associated channel then the channel is closed
* as well.
*
! * @exception IOException if an I/O error occurs when closing the socket.
* @revised 1.4
* @spec JSR-51
*/
public void close() throws IOException {
synchronized(closeLock) {
--- 672,682 ----
* a {@link SocketException}.
*
* <p> If this socket has an associated channel then the channel is closed
* as well.
*
! * @throws IOException if an I/O error occurs when closing the socket.
* @revised 1.4
* @spec JSR-51
*/
public void close() throws IOException {
synchronized(closeLock) {
*** 761,771 ****
/**
* Retrieve setting for {@link SocketOptions#SO_TIMEOUT SO_TIMEOUT}.
* 0 returns implies that the option is disabled (i.e., timeout of infinity).
* @return the {@link SocketOptions#SO_TIMEOUT SO_TIMEOUT} value
! * @exception IOException if an I/O error occurs
* @since 1.1
* @see #setSoTimeout(int)
*/
public synchronized int getSoTimeout() throws IOException {
if (isClosed())
--- 761,771 ----
/**
* Retrieve setting for {@link SocketOptions#SO_TIMEOUT SO_TIMEOUT}.
* 0 returns implies that the option is disabled (i.e., timeout of infinity).
* @return the {@link SocketOptions#SO_TIMEOUT SO_TIMEOUT} value
! * @throws IOException if an I/O error occurs
* @since 1.1
* @see #setSoTimeout(int)
*/
public synchronized int getSoTimeout() throws IOException {
if (isClosed())
*** 804,814 ****
* The behaviour when {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR} is
* enabled or disabled after a socket is bound (See {@link #isBound()})
* is not defined.
*
* @param on whether to enable or disable the socket option
! * @exception SocketException if an error occurs enabling or
* disabling the {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR}
* socket option, or the socket is closed.
* @since 1.4
* @see #getReuseAddress()
* @see #bind(SocketAddress)
--- 804,814 ----
* The behaviour when {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR} is
* enabled or disabled after a socket is bound (See {@link #isBound()})
* is not defined.
*
* @param on whether to enable or disable the socket option
! * @throws SocketException if an error occurs enabling or
* disabling the {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR}
* socket option, or the socket is closed.
* @since 1.4
* @see #getReuseAddress()
* @see #bind(SocketAddress)
*** 824,834 ****
/**
* Tests if {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR} is enabled.
*
* @return a {@code boolean} indicating whether or not
* {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR} is enabled.
! * @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since 1.4
* @see #setReuseAddress(boolean)
*/
public boolean getReuseAddress() throws SocketException {
--- 824,834 ----
/**
* Tests if {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR} is enabled.
*
* @return a {@code boolean} indicating whether or not
* {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR} is enabled.
! * @throws SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since 1.4
* @see #setReuseAddress(boolean)
*/
public boolean getReuseAddress() throws SocketException {
*** 883,896 ****
* the security manager's {@code checkSetFactory} method
* to ensure the operation is allowed.
* This could result in a SecurityException.
*
* @param fac the desired factory.
! * @exception IOException if an I/O error occurs when setting the
* socket factory.
! * @exception SocketException if the factory has already been defined.
! * @exception SecurityException if a security manager exists and its
* {@code checkSetFactory} method doesn't allow the operation.
* @see java.net.SocketImplFactory#createSocketImpl()
* @see SecurityManager#checkSetFactory
*/
public static synchronized void setSocketFactory(SocketImplFactory fac) throws IOException {
--- 883,896 ----
* the security manager's {@code checkSetFactory} method
* to ensure the operation is allowed.
* This could result in a SecurityException.
*
* @param fac the desired factory.
! * @throws IOException if an I/O error occurs when setting the
* socket factory.
! * @throws SocketException if the factory has already been defined.
! * @throws SecurityException if a security manager exists and its
* {@code checkSetFactory} method doesn't allow the operation.
* @see java.net.SocketImplFactory#createSocketImpl()
* @see SecurityManager#checkSetFactory
*/
public static synchronized void setSocketFactory(SocketImplFactory fac) throws IOException {
*** 926,942 ****
* <p>
* 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.
*
! * @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
*
* @param size the size to which to set the receive buffer
* size. This value must be greater than 0.
*
! * @exception IllegalArgumentException if the
* value is 0 or is negative.
*
* @since 1.4
* @see #getReceiveBufferSize
*/
--- 926,942 ----
* <p>
* 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.
*
! * @throws SocketException if there is an error
* in the underlying protocol, such as a TCP error.
*
* @param size the size to which to set the receive buffer
* size. This value must be greater than 0.
*
! * @throws IllegalArgumentException if the
* value is 0 or is negative.
*
* @since 1.4
* @see #getReceiveBufferSize
*/
*** 956,966 ****
*
* <p>Note, the value actually set in the accepted socket is determined by
* calling {@link Socket#getReceiveBufferSize()}.
* @return the value of the {@link SocketOptions#SO_RCVBUF SO_RCVBUF}
* option for this {@code Socket}.
! * @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @see #setReceiveBufferSize(int)
* @since 1.4
*/
public synchronized int getReceiveBufferSize()
--- 956,966 ----
*
* <p>Note, the value actually set in the accepted socket is determined by
* calling {@link Socket#getReceiveBufferSize()}.
* @return the value of the {@link SocketOptions#SO_RCVBUF SO_RCVBUF}
* option for this {@code Socket}.
! * @throws SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @see #setReceiveBufferSize(int)
* @since 1.4
*/
public synchronized int getReceiveBufferSize()
< prev index next >