I am an embedded programmer,but now am trying to analyze iOS logs for an issue where webview fails to load an URL. From the logs, I see the following
404230 (_:didStartProvisionalNavigation:)::Entry
404230 (_:didStartProvisionalNavigation:)::Exit
404250 (_:didFailProvisionalNavigation:withError:)::Entry
404250 (_:didFailProvisionalNavigation:withError:)::server with the specified hostname could not be found
404250 (_:didFailProvisionalNavigation:withError:)::Exit
It is observed that didFailProvisionalNavigation:withError
is called within 20 milliseconds after didStartProvisionalNavigation
with error as NSURLErrorCannotFindHost.
So following are my questions:
didStartProvisionalNavigation
and
didFailProvisionalNavigation:withError
, I am starting to wonder if
webview actually tried to resolve the domain name. Is this timing
normal, what is the default DNS lookup timeout?When iOS webview tried to resolve the domain name, the DNS server returned Standard query response, Refused
(Checked that in wireshark) which is why webview reported the error NSURLErrorCannotFindHost
.
Apparently since it is an DNS error, it invoked the callback _:didFailProvisionalNavigation:withError
few milliseconds after _:didStartProvisionalNavigation
. Had it been timeout, it might have taken longer.