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/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to