On Jun 27, 2012, at 1:12 PM, Josh Graessley wrote:
You can set the CFNETWORK_DIAGNOSTIC environment variable when starting your process to enable extra debugging.
Figured out the problem by watching the session video — it's CFNETWORK_DIAGNOSTICS.
Also, the output doesn't go to the Xcode console, for some reason, but it does log one message to the console naming the file to which it does log. I also see the messages in 'All Messages' in Console.app.
Also, this only appears to work on Mac OS, while I can only reproduce the bug on iOS :-(
CFNETWORK_DIAGNOSTIC=1
Enables internal CFNetwork event and state logging
CFNETWORK_DIAGNOSTIC=2
Adds information about how CFNetwork decides to make and re-use TCP sockets
With a value of "2" all I saw were message that start "CFNetwork Diagnostic: Enqueue Request"; and all these list are the details of the request, not any extra information about which socket the requests will be sent on.
CFNETWORK_DIAGNOSTIC=3
Adds decrypted bytes in and out - this one is dangerous and should be used with caution.
When I went up to this level I _did_ see the info I wanted, because the packet dumps are prefaced with the file descriptor ID and the remote endpoint, which lets me distinguish different sockets.
But again, this isn't helping me because I can't reproduce the bug on Mac OS. I thought it might take a larger number of simultaneous requests to make it happen, but I've gone up to 20 and haven't triggered it yet.