Re: One CFSocketStream opening multiple sockets (and failing)
Re: One CFSocketStream opening multiple sockets (and failing)
- Subject: Re: One CFSocketStream opening multiple sockets (and failing)
- From: "Quinn \"The Eskimo!\"" <email@hidden>
- Date: Mon, 07 Sep 2015 11:15:42 +0100
On 3 Sep 2015, at 20:38, Jens Alfke <email@hidden> wrote:
> What I’m seeing is that, although I only open one client connection, i.e. one call to CFStreamCreatePairWithSocketToHost, the server receives up to _three_ incoming TCP connections.
I don't have time to look at this issue as a whole, but I can offer insight into the above. Since 10.7 (and iOS 5?) the system has contained small connect-by-name code that:
1. resolves the name to a set of addresses
2. uses the routing table to work out how to prioritise those addresses
3. starts a connection to the best address
4. if that takes too long, starts a connection to other addresses
Normally this doesn't increase server load because step 3 connects before step 4 kicks in.
The gist of this was explained right here on MacNetworkProg.
<http://lists.apple.com/archives/ipv6-dev/2011/Jul/msg00009.html>
This algorithm has evolved over time and I'm not intimately familiar with the recent changes but its existence does explain part of this puzzle.
Share and Enjoy
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden