iOS - NSURLConnection connections to more than 5 different IPs over LAN
My app tries to determine the IP of a web server located on the same LAN
when it starts up.
It works out the IP range to scan, and uses NSURLConnection objects with a
1 second time out to determine whether an IP is reachable, and if it is,
try to call a service on it, if the service call is successful then we
know we've found the correct IP.
The problem though is that the app cannot open more than 5 connections at
a time, even though all the connections have different IPs to connect to.
I would get about a dozen connections firing off but the rest will just
report The request timed out. without ever leaving the device.
I have read that this restriction applies to NSURLConnection connections
to a single IP address, but as I said, each connection has its own
different IP.
I have also tried using the SCNetworkReachability to determine whether an
IP is reachable but all it tells me is that the IP addresses on the LAN
are reachable, in theory, without making an actual connection.
Are there reliable ways to connect to more IPs at a time?
No comments:
Post a Comment