8282529: Fix API Note in javadoc for javax.net.ssl.SSLSocket

Reviewed-by: wetmore, xuelei
This commit is contained in:
Zdenek Zambersky 2022-03-14 14:21:58 +00:00 committed by Bradford Wetmore
parent ea9eeea8ff
commit 08573cc3b2

View File

@ -174,17 +174,19 @@ import java.util.function.BiFunction;
* @apiNote
* When the connection is no longer needed, the client and server
* applications should each close both sides of their respective connection.
* For {@code SSLSocket} objects, for example, an application can call
* {@link Socket#shutdownOutput()} or {@link java.io.OutputStream#close()}
* for output stream close and call {@link Socket#shutdownInput()} or
* {@link java.io.InputStream#close()} for input stream close. Note that
* in some cases, closing the input stream may depend on the peer's output
* stream being closed first. If the connection is not closed in an orderly
* manner (for example {@link Socket#shutdownInput()} is called before the
* peer's write closure notification has been received), exceptions may
* be raised to indicate that an error has occurred. Once an
* {@code SSLSocket} is closed, it is not reusable: a new {@code SSLSocket}
* must be created.
* This can be done either in one shot by calling {@link Socket#close()},
* or by closing each side individually using
* {@link Socket#shutdownOutput()} / {@link Socket#shutdownInput()} which is
* useful for protocol versions that can support half-closed connections.
*
* <P> Note that in some cases, closing the input stream may depend on the
* peer's output stream being closed first. If the connection is not closed
* in an orderly manner (for example {@link Socket#shutdownInput()} is called
* before the peer's write closure notification has been received), exceptions
* may be raised to indicate that an error has occurred.
*
* <P> Once an {@code SSLSocket} is closed, it is not reusable: a new
* {@code SSLSocket} must be created.
*
* @see java.net.Socket
* @see SSLServerSocket