NSURLSession doesn't release delegate if NSURLSessionStreamTask created (macOS)
NSURLSession doesn't release delegate if NSURLSessionStreamTask created (macOS)
- Subject: NSURLSession doesn't release delegate if NSURLSessionStreamTask created (macOS)
- From: Alexey Belkevich <email@hidden>
- Date: Mon, 12 Sep 2016 13:55:39 +0300
Hello,
I've found strange behaviour of NSURLSession.
1) 'invalidateAndCancel' method does nothing if 'streamTaskWithHostName:port:' has been called. And the delegate is never released. I've tried this steps on macOS. And then I've checked it on iOS and everything works fine. But I've found out another problems that reproduces on both platforms.
2) 'invalidateAndCancel' method does nothing if 'streamTaskWithHostName:port:' has been called but 'captureStreams' method is never called.
So, if you don't capture the streams NSURLSession doesn't release delegate
3) 'cancel' on NSURLSessionStreamTask does nothing.
NSURLSession delegate doesn't receive 'URLSession:task:didCompleteWithError:'
Here is a sample project that demonstrates this issues on macOS and iOS:
https://github.com/belkevich/stream-task
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden