• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSURLSession doesn't release delegate if NSURLSessionStreamTask created (macOS)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: How to do isKindOfClass in Swift
  • Next by Date: Swift and Threads
  • Previous by thread: Re: How to do isKindOfClass in Swift
  • Next by thread: Swift and Threads
  • Index(es):
    • Date
    • Thread