No RFC for connection timeouts. For any RFC or other document, it is not possible to know in advance the conditions that exist on any network.
In general, you can expect a successful connection to be very fast; a ECONNREFUSED ( ConnectException: connection refused ) is about as fast; and the connection timeout ( ConnectException: connect timeout ) until it accepts, depending on the reason, the platform at both ends and the nature of the intermediate network. On Windows, I believe that the connection timeout consists of the total time of three connection attempts with timeouts of 6s, 12s and 24s, a total of 42s; on different Unixes, I think the total is more like the 70s, which may be the result of 3 attempts with timeouts of 10, 20 and 40. As you can see, it depends on the platform. There is also the problem that populating the backup queue on a Windows server will result in an RST for inbound SYNs, where on a Unix / Linux server this will not cause any response to inbound SYNs. A.
It should also be noted that in Java and contrary to many years of Javadoc:
A timeout with a zero connection does not imply an infinite timeout; it implies a default timeout for the platform, which, as shown above, does not exceed about 70 seconds,
You cannot specify a connection timeout that extends the platform by default; you can use it only to reduce the default platform.
source share