> To: cocoa-dev@lists.apple.com > From: glgue...@amug.org > Date: Mon, 25 May 2009 10:46:40 -0700 > Subject: Re: How to safely break read stream? > > Chris Gardner wrote: > > > I create a read stream with CFReadStreamOpen(), > > but I don't know how to safely break it. > > Eagerly waiting for your reply. > > > Eagerly waiting for your explanation of what you mean by "break". > > Do you mean "to interrupt normal reading"? > > Do you mean "to separate into sections"? > > Do you mean something else? > > Please describe what you are doing with the read stream, and what you > want to accomplish. Then describe what "break" means in reference to > the rest of what you are doing. > > -- GG >
Hi GG, Thanks for your reply. In your mailing list, you suggest me demonstrating what I want to do, so now I am describing it in detail, please see below. I want to receive data from FTP servers over a network with CFFTP API, and can safely stop transferring data at any time. Firstly, create the stream using CFReadStreamCreateWithFTPURL(). Secondly, set up my callbacks with CFReadStreamSetClient(). Thirdly, add it to the run-loop with CFReadStreamScheduleWithRunLoop(). Finally, open the stream with CFReadStreamOpen(). I'll get call-backs when information is available to be read. I can accomplish receiving data from FTP servers successfully. When transferring data, I stop it using CFReadStreamUnscheduleFromRunLoop() and CFReadStreamClose(). When I am resuming to connect the same file in FTP servers, I always get the same problem which show error code 530 that meams user not logged in. However, I can connect other files in FTP servers successfully. I guess the reason why I can not connect the same file again is that I did not interupt the read stream safely. So my question is...How can I resume to connect and receive data from the same file in FTP servers or how can I interupt the read stream safely. Here is my msn identifier chrisgard...@live.com if you could add me. Waiting for your reply. Best Regards, Chris. > _______________________________________________ > > 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/chrisgardner%40live.com > > This email sent to chrisgard...@live.com _________________________________________________________________ Windows Liveā¢: Keep your life in sync. Check it out! http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_012009_______________________________________________ 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