RFR(s): 8228580: DnsClient TCP socket timeout

Alan Bateman Alan.Bateman at oracle.com
Wed Sep 4 18:21:53 UTC 2019


On 04/09/2019 18:52, Pavel Rappo wrote:
> You are right, it definitely is a blocking operation. I missed it. I was focused on
>
>      712         sock.setSoTimeout(timeoutLeft);
>
> So I'd suggest we use explicit connect with timeout
>
>      java.net.Socket#connect(java.net.SocketAddress, int)
>
> Are you okay with that?
>
Decomposing timeouts is hard to get right. In this case I think you want 
to specify the initial timeout to connect, then set timeoutLeft to be 
the remaining (will be less than "timeout").

-Alan



More information about the core-libs-dev mailing list