How to use CFReadStrem and abort read stream normally?
How to use CFReadStrem and abort read stream normally?
- Subject: How to use CFReadStrem and abort read stream normally?
- From: Chris Gardner <email@hidden>
- Date: Fri, 22 May 2009 11:10:49 +0800
- Importance: Normal
Hi,
I have already read through CFReadStream archives, and still have trouble with it.
After CFReadStreamOpen() has been implement and its status is kCFStreamEventHasBytesAvailable,
so I can read data from the source.Of course, there's no problem. As for the FTP server,
I can connect it by using CFReadStreamCreateWithFTPURL.
Now, I would like to abort/disconnect the read stream when its status is kCFStreamEventHasBytesAvailable.
At that time. I will use CFReadStreamClose() and CFRunLoopStop().
As you know, the read stream was availabe in a run loop
where data stream can tranfer from FTP server to destination.
However, I met a terrible problem which show GDB:Program received signal:"EXC_BAD_ACCESS" as soon as I do above operation,
also I see the read stream's status become kCFStreamEventErrorOccurred.
So my question is...How can I avoid this error and how can I abort the read stream normally
when its status is kCFStreamEventHasBytesAvailable.
Your help will be appreciated.
Best Regards.
Chris Wu
_________________________________________________________________
More than messages–check out the rest of the Windows Live™.
http://www.microsoft.com/windows/windowslive/_______________________________________________
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