Skip to content

Commit 2f63d3a

Browse files
committed
7116990: (spec) Socket.connect(addr,timeout) not clear if IOException because of TCP timeout
Reviewed-by: alanb, dfuchs
1 parent 382f870 commit 2f63d3a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/java.base/share/classes/java/net/Socket.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,13 @@ public void connect(SocketAddress endpoint) throws IOException {
621621
* {@code SocketException} with the interrupt status set.
622622
* </ol>
623623
*
624+
* @apiNote Establishing a TCP/IP connection is subject to connect timeout settings
625+
* in the operating system. The typical operating system timeout is in the range of tens of
626+
* seconds to minutes. If the operating system timeout expires before the
627+
* {@code timeout} specified to this method then an {@code IOException} is thrown.
628+
* The {@code timeout} specified to this method is typically a timeout value that is
629+
* shorter than the operating system timeout.
630+
*
624631
* @param endpoint the {@code SocketAddress}
625632
* @param timeout the timeout value to be used in milliseconds.
626633
* @throws IOException if an error occurs during the connection, the socket

0 commit comments

Comments
 (0)