7116990: (spec) Socket.connect(addr,timeout) not clear if IOException because of TCP timeout

Reviewed-by: alanb, dfuchs
This commit is contained in:
Jaikiran Pai 2025-06-18 02:06:22 +00:00
parent 382f870cd5
commit 2f63d3aee5

View File

@ -621,6 +621,13 @@ public class Socket implements java.io.Closeable {
* {@code SocketException} with the interrupt status set.
* </ol>
*
* @apiNote Establishing a TCP/IP connection is subject to connect timeout settings
* in the operating system. The typical operating system timeout is in the range of tens of
* seconds to minutes. If the operating system timeout expires before the
* {@code timeout} specified to this method then an {@code IOException} is thrown.
* The {@code timeout} specified to this method is typically a timeout value that is
* shorter than the operating system timeout.
*
* @param endpoint the {@code SocketAddress}
* @param timeout the timeout value to be used in milliseconds.
* @throws IOException if an error occurs during the connection, the socket