Hi, everyone:
I use CFReadStreamCreateWithFTPURL function to create a
CFWriteStream,so that i can upload file to ftp server.
But,the is a problem,when i call CFWriteStreamWrite function to
update bytes to ftp server.because it will not block, so when i call
call CFWriteStreamClose to close the Stream after call
CFWriteStreamWrite. I found that some bytes haven't tranfer to ftp
server yet,so i got a error on ftp server with the file, it is smaller
than the file upload by me.
Could anybody know how to deal with this problem? by the way i'm not
using callback method wich recomand by apple, because it doesn't fit
with my class.
thx.
Mopelee - 29 Apr 2006 03:16 GMT
all about what i say is means is there any way, which i can test a
CFWriteStream is finish transfer data to remote ftp server, so that i
can release it safely. but it not using event
Michael Ash - 29 Apr 2006 03:47 GMT
> Hi, everyone:
>
[quoted text clipped - 10 lines]
> using callback method wich recomand by apple, because it doesn't fit
> with my class.
So, make it fit. You're using a nonblocking asynchronous API, you'd better
get used to the idea and figure out how to work with it. If you *really*
need it to be exposed as a blocking write, you should probably wrap it in
your own functions, probably by using a separate thread to actually run
the runloop that contains the write stream.

Signature
Michael Ash
Rogue Amoeba Software
Mopelee - 29 Apr 2006 04:07 GMT
Michael Ash :
thank u very much. may i know is there any function can polling for
is CFWriteStreamWrite function write to socket finished and successed?
i have try to read all the .h file of CoreFounadation and CoreService
=> CFNetwork but , no function seems to do such thing! so must i listen
to [kCFStreamEventEndEncountered] event.
i think, perhaps i should begin to write this case by socket but not CF!
Michael Ash - 29 Apr 2006 04:43 GMT
> Michael Ash :
> thank u very much. may i know is there any function can polling for
> is CFWriteStreamWrite function write to socket finished and successed?
> i have try to read all the .h file of CoreFounadation and CoreService
> => CFNetwork but , no function seems to do such thing! so must i listen
> to [kCFStreamEventEndEncountered] event.
You are merely restating your original question, which I already answered.
Perhaps you did not understand the answer, in which case I suggest you go
back and read my post again.

Signature
Michael Ash
Rogue Amoeba Software
Mopelee - 30 Apr 2006 08:19 GMT
Michael Ash:
I write a callback function as friend of my class to resolve the
problem,but i found the problem still exist.
So i download the FTP sample from apple site again. i found the
sample have got the same problem.
when i set the upload speed to 10k, then sample cann't finnished upload
the full file. but set upload speed with no limit, it can upload all
size of the file.perhaps really there is some bug in FTP api provide by
apple.
now, i have to find some other way to deal with my project. it is
really a terrible thing.