Popping in to say Ethan's advice saved me hours of headache. I've fought with the native URLSession and WebSocketTask APIs for about eight months, and used it across our fleet. Out of nowhere, socket connections would make no progress, and just retry every ten seconds. The instructions for debugging CFNetwork were of no use, and I had nearly no logs from CFNetwork explaining what was going on. Setting the debugging environment variable did nothing, the task just wouldn't budge. It's on brand with the overall experience of the Network framework, unfortunately.
I switched over to WebSocketKit and have been beyond pleased. It has a very simple API and makes it very easy to migrate your URLSession code to it, usually with far less code being needed.
Topic:
App & System Services
SubTopic:
General
Tags: