• 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
stale NSURLConnections
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

stale NSURLConnections


  • Subject: stale NSURLConnections
  • From: Andreas Monitzer <email@hidden>
  • Date: Thu, 17 Jun 2004 10:42:57 +0200

Hi,

I'm writing an app that uses NSURLConnection for getting some files (using the delegate callbacks), and sometimes, that connection just sits there and does nothing, even though the timeout should have killed it a while ago (the server is working properly).
I tried to create a workaround by using an NSTimer that kicks in right after the timeout should have killed the connection, sends the -cancel message to the connection if it's still there without having received any data and quits the thread. That works fine in the UI, since I can tell when it has timed out (which is bad anyways, since it shouldn't time out when the server is working properly).
However, the NSURLConnection is not released (even though the thread itself has already terminated and the retain/releases are properly balanced), and the file descriptor is kept open. Fetching is occurring periodically, so after a while the per-process limit of open file descriptors is reached (256 I think), and the process quits silently (since NSAlert can't even put up an alert box, since the nib-file can't be loaded).

See also http://nslog.com/archives/2004/05/21/poof_whered_my_app_go.php for the user-side description of the problem.

Has anybody an idea how to fix that problem? (I'm particularly interested in solutions for the initial problem, not the one that's caused by the workaround)

thanks,
andy
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Prev by Date: Re: Color of string with link attribute
  • Next by Date: Re: [newbie] numeric strings
  • Previous by thread: PMSessionSetDestination 3 results?
  • Next by thread: Detail view beginner question
  • Index(es):
    • Date
    • Thread