Re: NSURL and lingering FTP processes
Re: NSURL and lingering FTP processes
- Subject: Re: NSURL and lingering FTP processes
- From: Daniel Jalkut <email@hidden>
- Date: Sun, 28 Mar 2004 13:54:39 -0800
Hi Joe - I think the underlying FTP implementation defaults to "keeping
connections open" because it helps performance when repeated requests
are made to the same server. The CFFTPStream interface published with
10.3 has a property for configuring this behavior on or off.
This property is not published with the NSURL interface to FTP loading,
but I think the NSURL will "pass through" property settings that it
doesn't understand to to the underlying CFNetwork implementation that
is serving the NSURL request.
Try using "setProperty:forKey:" with the key
kCFStreamPropertyFTPAttemptPersistentConnection (from CFFTPStream.h).
If this works for you, you might request that the property be published
(and therefore supported) as part of the NSURL interface. Alternately,
you could switch to using CFNetwork directly if you don't need to
support pre-10.3 systems.
Daniel
On Mar 25, 2004, at 8:54 AM, Joe Lester wrote:
My app is downloading remote files from an FTP server like so (typed
in Mail)...
NSData *data = [url resourceDataUsingCache:NO];
This has been working well for me. The problem is that the ftp
processes are staying open on the ftp server until they finally time
out after 900 seconds. Here's what it looks like in ftp.log...
Mar 25 10:54:14 OfficeLink-Server ftpd[9710]: User joe timed out after
900 seconds
Is there anything I'm failing to do on the Cocoa API side that could
be causing the FTP process to remain open? Or, to ask the question in
reverse... Is there anything I can do, at the Cocoa API level, to make
the FTP process gracefully shut down immediately after I'm done
messaging resourceDataUsingCache?
_______________________________________________
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.
_______________________________________________
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.