1 of 1 people found this helpful
Can I ask if anyone knows if CFStreamCreatePairWithSocketToHost can scan across an IP range?
Under the covers socket stream simply opens a TCP connection to the DNS name (or IP address) and port you specify. That’s good, in that it’s the only guaranteed way to determine if the device can, at this instant, connect to that DNS name and port. However, there’s no way to open TCP connections to a range of IP addresses; that simply does not make sense at the TCP level.
You can, however, do this stuff in parallel, that is, open 10 socket streams to the 10 different DNS name and port pairs.
However, this sounds like preflighting to me, and that’s rarely a good idea. The fact that you were able to open a connection a few minutes ago is no guarantee that you can open a connection now. In most cases you want to avoid preflighting, and instead do the network operations you need to do when you need to do them, and deal with any errors you encounter.
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"