Do not retry queries when socket remote hung up
When the remote hung up on the socket used to transmit DNS resolver results, there is no point continuing to retry queries. Detect whether the remote has hung up using poll with POLLHUP and do not retry in that case. This still sends the first query in any case to avoid the poll check and minimize latency in the common case. Closing the socket is what DnsResolver.java does via resNetworkCancel, so this effectively implements the CancellationSignal in the DnsResolver API. Test: atest CtsNetTestCases:android.net.cts.DnsResolverCancellationTest Change-Id: I4631dd97358e2ddaa7de7801b4188ac90185ead0
Loading
Please register or sign in to comment