IOS when calling a web service, the server with the specified host name was not found

The random error I get when I try to call api

The following is a snippet from the error description.

NSLocalizedDescription = "A server with the specified hostname may not be found."; NSUnderlyingError = "Domain Error = kCFErrorDomainCFNetwork Code = -1003 \" A server with the specified host name could not be found. \ "

The error is very frequent, and it disappears on the next call. Can someone help me identify the root cause?

+4
source share
3 answers

The error is due to the host not found.

kCFURLErrorCannotFindHost = -1003,
kCFURLErrorCannotFindHost
The connection failed because the host could not be found.

. CFNetworkErrors

0

, . , , .

0

Maybe something is wrong with the DNS server, you need to ping the host and check if the host is accessible.

0
source

Source: https://habr.com/ru/post/1528964/


All Articles