Getting EADDRNOTAVAIL when WiFi turned off, plus "nw_socket_output_finished" log
site_archiver@lists.apple.com Delivered-To: macnetworkprog@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=aVuTDJktpUY5WORpdb8jUC7TW3csR 7PChhfD+De3Zkw=; b=DXKg8sde/mGrsUpytdZwb+O+IELcHBE9ciU27AICYfk+I Pxw9qm5ptwU3zJ5VkB4G4mmUxqskrzog6k0JrOyhNG063VRQZ0aCI43WPsIGqvaS pizOFBUulI0hNh9j0dT27AUwtEF0iygdHouoXXuL9H1EDH9/XLutwS+5QJXj3gsb pUYZfL0sLgHOV8J92Sc0JFBIFA2e+w1dHW2WbC+z/6Ze1BsTxS7RZv/hMqCAPFT+ 9fcwMWBDtUFtaMMxSWdz+1Hat/SL6diYSytdfIvORrWnSYLaieaUHshixAMMvNHN ytqV4zDBuKtZrBmVPUDifE6K85q/86IOZx9lCF8Ig== I’ve got code that uses NSURLSessionStreamTask to run a TCP socket. Obviously if the user turns off WiFi on their iPhone while the socket is open, the task closes and calls the delegate's -didCloseWithError: method. The weird part is that I have a report from a tester that, at least in some cases, the error is {NSPOSIXErrorDomain, EADDRNOTAVAIL}. It’s been a while since I worked on this code, but it’s expecting to get errors in NSURLErrorDomain. (It looks at the error to decide what to do about the disconnect, i.e. whether to try to reconnect later.) Also, there are some messages being logged by the OS when this occurs, which makes me think this might be something unexpected: 2017-12-19 18:42:00.346820-0500 TravelSample[2046:1049637] [] nw_socket_output_finished shutdown(12, SHUT_WR): [49] Can't assign requested address 2017-12-19 18:42:00.348878-0500 TravelSample[2046:1049732] TIC Read Status [2:0x0]: 1:49 (I’m unsure of the exact iOS version, but it’s probably 11.x.) —Jens _______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (Macnetworkprog@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/macnetworkprog/site_archiver%40lists... This email sent to site_archiver@lists.apple.com
participants (1)
-
Jens Alfke