< prev index next >
src/java.base/share/classes/java/net/Socket.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
*** 178,188 ****
* SocketImpl.
*
* @param impl an instance of a <B>SocketImpl</B>
* the subclass wishes to use on the Socket.
*
! * @exception SocketException if there is an error in the underlying protocol,
* such as a TCP error.
* @since 1.1
*/
protected Socket(SocketImpl impl) throws SocketException {
this.impl = impl;
--- 178,188 ----
* SocketImpl.
*
* @param impl an instance of a <B>SocketImpl</B>
* the subclass wishes to use on the Socket.
*
! * @throws SocketException if there is an error in the underlying protocol,
* such as a TCP error.
* @since 1.1
*/
protected Socket(SocketImpl impl) throws SocketException {
this.impl = impl;
*** 209,225 ****
* as its arguments. This could result in a SecurityException.
*
* @param host the host name, or {@code null} for the loopback address.
* @param port the port number.
*
! * @exception UnknownHostException if the IP address of
* the host could not be determined.
*
! * @exception IOException if an I/O error occurs when creating the socket.
! * @exception SecurityException if a security manager exists and its
* {@code checkConnect} 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.Socket#setSocketImplFactory(java.net.SocketImplFactory)
* @see java.net.SocketImpl
* @see java.net.SocketImplFactory#createSocketImpl()
--- 209,225 ----
* as its arguments. This could result in a SecurityException.
*
* @param host the host name, or {@code null} for the loopback address.
* @param port the port number.
*
! * @throws UnknownHostException if the IP address of
* the host could not be determined.
*
! * @throws IOException if an I/O error occurs when creating the socket.
! * @throws SecurityException if a security manager exists and its
* {@code checkConnect} 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.Socket#setSocketImplFactory(java.net.SocketImplFactory)
* @see java.net.SocketImpl
* @see java.net.SocketImplFactory#createSocketImpl()
*** 247,263 ****
* with the host address and {@code port}
* as its arguments. This could result in a SecurityException.
*
* @param address the IP address.
* @param port the port number.
! * @exception IOException if an I/O error occurs when creating the socket.
! * @exception SecurityException if a security manager exists and its
* {@code checkConnect} 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.
! * @exception NullPointerException if {@code address} is null.
* @see java.net.Socket#setSocketImplFactory(java.net.SocketImplFactory)
* @see java.net.SocketImpl
* @see java.net.SocketImplFactory#createSocketImpl()
* @see SecurityManager#checkConnect
*/
--- 247,263 ----
* with the host address and {@code port}
* as its arguments. This could result in a SecurityException.
*
* @param address the IP address.
* @param port the port number.
! * @throws IOException if an I/O error occurs when creating the socket.
! * @throws SecurityException if a security manager exists and its
* {@code checkConnect} 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.
! * @throws NullPointerException if {@code address} is null.
* @see java.net.Socket#setSocketImplFactory(java.net.SocketImplFactory)
* @see java.net.SocketImpl
* @see java.net.SocketImplFactory#createSocketImpl()
* @see SecurityManager#checkConnect
*/
*** 289,304 ****
* @param port the remote port
* @param localAddr the local address the socket is bound to, or
* {@code null} for the {@code anyLocal} address.
* @param localPort the local port the socket is bound to, or
* {@code zero} for a system selected free port.
! * @exception IOException if an I/O error occurs when creating the socket.
! * @exception SecurityException if a security manager exists and its
* {@code checkConnect} method doesn't allow the connection
* to the destination, or if its {@code checkListen} method
* doesn't allow the bind to the local port.
! * @exception IllegalArgumentException if the port parameter or localPort
* parameter is outside the specified range of valid port values,
* which is between 0 and 65535, inclusive.
* @see SecurityManager#checkConnect
* @since 1.1
*/
--- 289,304 ----
* @param port the remote port
* @param localAddr the local address the socket is bound to, or
* {@code null} for the {@code anyLocal} address.
* @param localPort the local port the socket is bound to, or
* {@code zero} for a system selected free port.
! * @throws IOException if an I/O error occurs when creating the socket.
! * @throws SecurityException if a security manager exists and its
* {@code checkConnect} method doesn't allow the connection
* to the destination, or if its {@code checkListen} method
* doesn't allow the bind to the local port.
! * @throws IllegalArgumentException if the port parameter or localPort
* parameter is outside the specified range of valid port values,
* which is between 0 and 65535, inclusive.
* @see SecurityManager#checkConnect
* @since 1.1
*/
*** 330,348 ****
* @param port the remote port
* @param localAddr the local address the socket is bound to, or
* {@code null} for the {@code anyLocal} address.
* @param localPort the local port the socket is bound to or
* {@code zero} for a system selected free port.
! * @exception IOException if an I/O error occurs when creating the socket.
! * @exception SecurityException if a security manager exists and its
* {@code checkConnect} method doesn't allow the connection
* to the destination, or if its {@code checkListen} method
* doesn't allow the bind to the local port.
! * @exception IllegalArgumentException if the port parameter or localPort
* parameter is outside the specified range of valid port values,
* which is between 0 and 65535, inclusive.
! * @exception NullPointerException if {@code address} is null.
* @see SecurityManager#checkConnect
* @since 1.1
*/
public Socket(InetAddress address, int port, InetAddress localAddr,
int localPort) throws IOException {
--- 330,348 ----
* @param port the remote port
* @param localAddr the local address the socket is bound to, or
* {@code null} for the {@code anyLocal} address.
* @param localPort the local port the socket is bound to or
* {@code zero} for a system selected free port.
! * @throws IOException if an I/O error occurs when creating the socket.
! * @throws SecurityException if a security manager exists and its
* {@code checkConnect} method doesn't allow the connection
* to the destination, or if its {@code checkListen} method
* doesn't allow the bind to the local port.
! * @throws IllegalArgumentException if the port parameter or localPort
* parameter is outside the specified range of valid port values,
* which is between 0 and 65535, inclusive.
! * @throws NullPointerException if {@code address} is null.
* @see SecurityManager#checkConnect
* @since 1.1
*/
public Socket(InetAddress address, int port, InetAddress localAddr,
int localPort) throws IOException {
*** 378,391 ****
*
* @param host the host name, or {@code null} for the loopback address.
* @param port the port number.
* @param stream a {@code boolean} indicating whether this is
* a stream socket or a datagram socket.
! * @exception IOException if an I/O error occurs when creating the socket.
! * @exception SecurityException if a security manager exists and its
* {@code checkConnect} 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.Socket#setSocketImplFactory(java.net.SocketImplFactory)
* @see java.net.SocketImpl
* @see java.net.SocketImplFactory#createSocketImpl()
--- 378,391 ----
*
* @param host the host name, or {@code null} for the loopback address.
* @param port the port number.
* @param stream a {@code boolean} indicating whether this is
* a stream socket or a datagram socket.
! * @throws IOException if an I/O error occurs when creating the socket.
! * @throws SecurityException if a security manager exists and its
* {@code checkConnect} 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.Socket#setSocketImplFactory(java.net.SocketImplFactory)
* @see java.net.SocketImpl
* @see java.net.SocketImplFactory#createSocketImpl()
*** 421,437 ****
*
* @param host the IP address.
* @param port the port number.
* @param stream if {@code true}, create a stream socket;
* otherwise, create a datagram socket.
! * @exception IOException if an I/O error occurs when creating the socket.
! * @exception SecurityException if a security manager exists and its
* {@code checkConnect} 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.
! * @exception NullPointerException if {@code host} is null.
* @see java.net.Socket#setSocketImplFactory(java.net.SocketImplFactory)
* @see java.net.SocketImpl
* @see java.net.SocketImplFactory#createSocketImpl()
* @see SecurityManager#checkConnect
* @deprecated Use DatagramSocket instead for UDP transport.
--- 421,437 ----
*
* @param host the IP address.
* @param port the port number.
* @param stream if {@code true}, create a stream socket;
* otherwise, create a datagram socket.
! * @throws IOException if an I/O error occurs when creating the socket.
! * @throws SecurityException if a security manager exists and its
* {@code checkConnect} 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.
! * @throws NullPointerException if {@code host} is null.
* @see java.net.Socket#setSocketImplFactory(java.net.SocketImplFactory)
* @see java.net.SocketImpl
* @see java.net.SocketImplFactory#createSocketImpl()
* @see SecurityManager#checkConnect
* @deprecated Use DatagramSocket instead for UDP transport.
*** 865,875 ****
*
* <p> Closing the returned {@link java.io.InputStream InputStream}
* will close the associated socket.
*
* @return an input stream for reading bytes from this socket.
! * @exception IOException if an I/O error occurs when creating the
* input stream, the socket is closed, the socket is
* not connected, or the socket input has been shutdown
* using {@link #shutdownInput()}
*
* @revised 1.4
--- 865,875 ----
*
* <p> Closing the returned {@link java.io.InputStream InputStream}
* will close the associated socket.
*
* @return an input stream for reading bytes from this socket.
! * @throws IOException if an I/O error occurs when creating the
* input stream, the socket is closed, the socket is
* not connected, or the socket input has been shutdown
* using {@link #shutdownInput()}
*
* @revised 1.4
*** 940,950 ****
*
* <p> Closing the returned {@link java.io.OutputStream OutputStream}
* will close the associated socket.
*
* @return an output stream for writing bytes to this socket.
! * @exception IOException if an I/O error occurs when creating the
* output stream or if the socket is not connected.
* @revised 1.4
* @spec JSR-51
*/
public OutputStream getOutputStream() throws IOException {
--- 940,950 ----
*
* <p> Closing the returned {@link java.io.OutputStream OutputStream}
* will close the associated socket.
*
* @return an output stream for writing bytes to this socket.
! * @throws IOException if an I/O error occurs when creating the
* output stream or if the socket is not connected.
* @revised 1.4
* @spec JSR-51
*/
public OutputStream getOutputStream() throws IOException {
*** 1000,1010 ****
* (disable/enable Nagle's algorithm).
*
* @param on {@code true} to enable TCP_NODELAY,
* {@code false} to disable.
*
! * @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
*
* @since 1.1
*
* @see #getTcpNoDelay()
--- 1000,1010 ----
* (disable/enable Nagle's algorithm).
*
* @param on {@code true} to enable TCP_NODELAY,
* {@code false} to disable.
*
! * @throws SocketException if there is an error
* in the underlying protocol, such as a TCP error.
*
* @since 1.1
*
* @see #getTcpNoDelay()
*** 1018,1028 ****
/**
* Tests if {@link SocketOptions#TCP_NODELAY TCP_NODELAY} is enabled.
*
* @return a {@code boolean} indicating whether or not
* {@link SocketOptions#TCP_NODELAY TCP_NODELAY} is enabled.
! * @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since 1.1
* @see #setTcpNoDelay(boolean)
*/
public boolean getTcpNoDelay() throws SocketException {
--- 1018,1028 ----
/**
* Tests if {@link SocketOptions#TCP_NODELAY TCP_NODELAY} is enabled.
*
* @return a {@code boolean} indicating whether or not
* {@link SocketOptions#TCP_NODELAY TCP_NODELAY} is enabled.
! * @throws SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since 1.1
* @see #setTcpNoDelay(boolean)
*/
public boolean getTcpNoDelay() throws SocketException {
*** 1038,1050 ****
*
* The setting only affects socket close.
*
* @param on whether or not to linger on.
* @param linger how long to linger for, if on is true.
! * @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
! * @exception IllegalArgumentException if the linger value is negative.
* @since 1.1
* @see #getSoLinger()
*/
public void setSoLinger(boolean on, int linger) throws SocketException {
if (isClosed())
--- 1038,1050 ----
*
* The setting only affects socket close.
*
* @param on whether or not to linger on.
* @param linger how long to linger for, if on is true.
! * @throws SocketException if there is an error
* in the underlying protocol, such as a TCP error.
! * @throws IllegalArgumentException if the linger value is negative.
* @since 1.1
* @see #getSoLinger()
*/
public void setSoLinger(boolean on, int linger) throws SocketException {
if (isClosed())
*** 1067,1077 ****
* option is disabled.
*
* The setting only affects socket close.
*
* @return the setting for {@link SocketOptions#SO_LINGER SO_LINGER}.
! * @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since 1.1
* @see #setSoLinger(boolean, int)
*/
public int getSoLinger() throws SocketException {
--- 1067,1077 ----
* option is disabled.
*
* The setting only affects socket close.
*
* @return the setting for {@link SocketOptions#SO_LINGER SO_LINGER}.
! * @throws SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since 1.1
* @see #setSoLinger(boolean, int)
*/
public int getSoLinger() throws SocketException {
*** 1089,1099 ****
* Send one byte of urgent data on the socket. The byte to be sent is the lowest eight
* bits of the data parameter. The urgent byte is
* sent after any preceding writes to the socket OutputStream
* and before any future writes to the OutputStream.
* @param data The byte of data to send
! * @exception IOException if there is an error
* sending the data.
* @since 1.4
*/
public void sendUrgentData (int data) throws IOException {
if (!getImpl().supportsUrgentData ()) {
--- 1089,1099 ----
* Send one byte of urgent data on the socket. The byte to be sent is the lowest eight
* bits of the data parameter. The urgent byte is
* sent after any preceding writes to the socket OutputStream
* and before any future writes to the OutputStream.
* @param data The byte of data to send
! * @throws IOException if there is an error
* sending the data.
* @since 1.4
*/
public void sendUrgentData (int data) throws IOException {
if (!getImpl().supportsUrgentData ()) {
*** 1118,1128 ****
*
* @param on {@code true} to enable
* {@link SocketOptions#SO_OOBINLINE SO_OOBINLINE},
* {@code false} to disable.
*
! * @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
*
* @since 1.4
*
* @see #getOOBInline()
--- 1118,1128 ----
*
* @param on {@code true} to enable
* {@link SocketOptions#SO_OOBINLINE SO_OOBINLINE},
* {@code false} to disable.
*
! * @throws SocketException if there is an error
* in the underlying protocol, such as a TCP error.
*
* @since 1.4
*
* @see #getOOBInline()
*** 1137,1147 ****
* Tests if {@link SocketOptions#SO_OOBINLINE SO_OOBINLINE} is enabled.
*
* @return a {@code boolean} indicating whether or not
* {@link SocketOptions#SO_OOBINLINE SO_OOBINLINE} is enabled.
*
! * @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since 1.4
* @see #setOOBInline(boolean)
*/
public boolean getOOBInline() throws SocketException {
--- 1137,1147 ----
* Tests if {@link SocketOptions#SO_OOBINLINE SO_OOBINLINE} is enabled.
*
* @return a {@code boolean} indicating whether or not
* {@link SocketOptions#SO_OOBINLINE SO_OOBINLINE} is enabled.
*
! * @throws SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since 1.4
* @see #setOOBInline(boolean)
*/
public boolean getOOBInline() throws SocketException {
*** 1180,1190 ****
/**
* Returns setting for {@link SocketOptions#SO_TIMEOUT SO_TIMEOUT}.
* 0 returns implies that the option is disabled (i.e., timeout of infinity).
*
* @return the setting for {@link SocketOptions#SO_TIMEOUT SO_TIMEOUT}
! * @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
*
* @since 1.1
* @see #setSoTimeout(int)
*/
--- 1180,1190 ----
/**
* Returns setting for {@link SocketOptions#SO_TIMEOUT SO_TIMEOUT}.
* 0 returns implies that the option is disabled (i.e., timeout of infinity).
*
* @return the setting for {@link SocketOptions#SO_TIMEOUT SO_TIMEOUT}
! * @throws SocketException if there is an error
* in the underlying protocol, such as a TCP error.
*
* @since 1.1
* @see #setSoTimeout(int)
*/
*** 1209,1225 ****
*
* <p>Because {@link SocketOptions#SO_SNDBUF SO_SNDBUF} is a hint,
* applications that want to verify what size the buffers were set to
* should call {@link #getSendBufferSize()}.
*
! * @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 send buffer
* size. This value must be greater than 0.
*
! * @exception IllegalArgumentException if the
* value is 0 or is negative.
*
* @see #getSendBufferSize()
* @since 1.2
*/
--- 1209,1225 ----
*
* <p>Because {@link SocketOptions#SO_SNDBUF SO_SNDBUF} is a hint,
* applications that want to verify what size the buffers were set to
* should call {@link #getSendBufferSize()}.
*
! * @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 send buffer
* size. This value must be greater than 0.
*
! * @throws IllegalArgumentException if the
* value is 0 or is negative.
*
* @see #getSendBufferSize()
* @since 1.2
*/
*** 1238,1248 ****
* for this {@code Socket}, that is the buffer size used by the platform
* for output on this {@code Socket}.
* @return the value of the {@link SocketOptions#SO_SNDBUF SO_SNDBUF}
* option for this {@code Socket}.
*
! * @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
*
* @see #setSendBufferSize(int)
* @since 1.2
*/
--- 1238,1248 ----
* for this {@code Socket}, that is the buffer size used by the platform
* for output on this {@code Socket}.
* @return the value of the {@link SocketOptions#SO_SNDBUF SO_SNDBUF}
* option for this {@code Socket}.
*
! * @throws SocketException if there is an error
* in the underlying protocol, such as a TCP error.
*
* @see #setSendBufferSize(int)
* @since 1.2
*/
*** 1285,1298 ****
* <li>For client sockets, setReceiveBufferSize() must be called before
* connecting the socket to its remote peer.</li></ol>
* @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.
*
! * @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
*
* @see #getReceiveBufferSize()
* @see ServerSocket#setReceiveBufferSize(int)
* @since 1.2
--- 1285,1298 ----
* <li>For client sockets, setReceiveBufferSize() must be called before
* connecting the socket to its remote peer.</li></ol>
* @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.
*
! * @throws SocketException if there is an error
* in the underlying protocol, such as a TCP error.
*
* @see #getReceiveBufferSize()
* @see ServerSocket#setReceiveBufferSize(int)
* @since 1.2
*** 1312,1322 ****
* for this {@code Socket}, that is the buffer size used by the platform
* for input on this {@code Socket}.
*
* @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.2
*/
public synchronized int getReceiveBufferSize()
--- 1312,1322 ----
* for this {@code Socket}, that is the buffer size used by the platform
* for input on this {@code Socket}.
*
* @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.2
*/
public synchronized int getReceiveBufferSize()
*** 1333,1343 ****
/**
* Enable/disable {@link SocketOptions#SO_KEEPALIVE SO_KEEPALIVE}.
*
* @param on whether or not to have socket keep alive turned on.
! * @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since 1.3
* @see #getKeepAlive()
*/
public void setKeepAlive(boolean on) throws SocketException {
--- 1333,1343 ----
/**
* Enable/disable {@link SocketOptions#SO_KEEPALIVE SO_KEEPALIVE}.
*
* @param on whether or not to have socket keep alive turned on.
! * @throws SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since 1.3
* @see #getKeepAlive()
*/
public void setKeepAlive(boolean on) throws SocketException {
*** 1349,1359 ****
/**
* Tests if {@link SocketOptions#SO_KEEPALIVE SO_KEEPALIVE} is enabled.
*
* @return a {@code boolean} indicating whether or not
* {@link SocketOptions#SO_KEEPALIVE SO_KEEPALIVE} is enabled.
! * @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since 1.3
* @see #setKeepAlive(boolean)
*/
public boolean getKeepAlive() throws SocketException {
--- 1349,1359 ----
/**
* Tests if {@link SocketOptions#SO_KEEPALIVE SO_KEEPALIVE} is enabled.
*
* @return a {@code boolean} indicating whether or not
* {@link SocketOptions#SO_KEEPALIVE SO_KEEPALIVE} is enabled.
! * @throws SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since 1.3
* @see #setKeepAlive(boolean)
*/
public boolean getKeepAlive() throws SocketException {
*** 1468,1478 ****
* 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)
--- 1468,1478 ----
* 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)
*** 1488,1498 ****
/**
* 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 {
--- 1488,1498 ----
/**
* 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 {
*** 1516,1526 ****
* {@link java.io.OutputStream OutputStream}.
*
* <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 this socket.
* @revised 1.4
* @spec JSR-51
* @see #isClosed
*/
public synchronized void close() throws IOException {
--- 1516,1526 ----
* {@link java.io.OutputStream OutputStream}.
*
* <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 this socket.
* @revised 1.4
* @spec JSR-51
* @see #isClosed
*/
public synchronized void close() throws IOException {
*** 1540,1550 ****
* <p>
* If you read from a socket input stream after invoking this method on the
* socket, the stream's {@code available} method will return 0, and its
* {@code read} methods will return {@code -1} (end of stream).
*
! * @exception IOException if an I/O error occurs when shutting down this
* socket.
*
* @since 1.3
* @see java.net.Socket#shutdownOutput()
* @see java.net.Socket#close()
--- 1540,1550 ----
* <p>
* If you read from a socket input stream after invoking this method on the
* socket, the stream's {@code available} method will return 0, and its
* {@code read} methods will return {@code -1} (end of stream).
*
! * @throws IOException if an I/O error occurs when shutting down this
* socket.
*
* @since 1.3
* @see java.net.Socket#shutdownOutput()
* @see java.net.Socket#close()
*** 1570,1580 ****
*
* If you write to a socket output stream after invoking
* shutdownOutput() on the socket, the stream will throw
* an IOException.
*
! * @exception IOException if an I/O error occurs when shutting down this
* socket.
*
* @since 1.3
* @see java.net.Socket#shutdownInput()
* @see java.net.Socket#close()
--- 1570,1580 ----
*
* If you write to a socket output stream after invoking
* shutdownOutput() on the socket, the stream will throw
* an IOException.
*
! * @throws IOException if an I/O error occurs when shutting down this
* socket.
*
* @since 1.3
* @see java.net.Socket#shutdownInput()
* @see java.net.Socket#close()
*** 1698,1711 ****
* 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 is already 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 setSocketImplFactory(SocketImplFactory fac)
--- 1698,1711 ----
* 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 is already 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 setSocketImplFactory(SocketImplFactory fac)
< prev index next >