Chris Gardner wrote:

Firstly, I will close the CFReadStream with CFReadStreamClose.
Secondly, I will use a new CFReadStream, and perform all the same setup as I did before to download the same file, meanwhile I am using kCFStreamPropertyFTPFileTransferOffset to
offset the length of file data that I have downloaded.


You should have included that in your earlier description. It would have saved some time.


At this point it's not clear whether the CFReadStream functions doing the right thing or not.

Christian Weykopf's link to:

http://lists.apple.com/archives/macnetworkprog/2009/Jan/msg00010.html

may or may not be relevant, because that post uses NSURLConnection.


I suggest treating the CFReadStream and all its related CF functions as a black box, and looking directly at its inputs and outputs on the network. That is, use a tool like Interarchy to watch network traffic as you run your code, then compare to what the FTP RFC says it should be doing. Tell Interarchy to watch all traffic on the active network interface, including TCP protocol packets, as those will show you important details of when and how connections are made.

You will need some understanding of the FTP protocol, and you will need to know some details of how TCP/IP works.

The goal is to figure out exactly what CFReadStream is doing to establish or restart the FTP connection. If it does the wrong thing with the TCP connections or the FTP protocol, then you are probably wasting your time trying to figure out how to make it work correctly.


Finally, your question is fundamentally a networking question, not a Cocoa question. You might get better advice by asking on a list where this is on-topic, such as macnetworkprog. CFReadStream isn't Cocoa, and even if it were, there's likely a greater concentration of network expertise on macnetworkprog than there is here.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to