What causes a kCFStreamEventEndEncountered
What causes a kCFStreamEventEndEncountered
- Subject: What causes a kCFStreamEventEndEncountered
- From: Liwei <email@hidden>
- Date: Sun, 13 Jul 2008 15:49:47 +0800
Hello all,
I'm attempting to write an event based stream handler for a
project I'm working on.
I've created the stream with CFStreamCreatePairWithSocketToHost
and added them to my main run loop with
CFWriteStreamSetClient/CFReadStreamSetClient and
CFWriteStreamScheduleWithRunLoop/CFReadStreamScheduleWithRunLoop.
The callback functions simply check for
kCFStreamEventCanAcceptBytes and kCFStreamEventHasBytesAvailable and
sends from or reads to a write/read buffer accordingly.
The reading works fine but I get a kCFStreamEventEndEncountered
for the write stream as soon as I start my run loop. However, if I
fill my write buffer before starting the run loop, the buffered data
is actually sent out, but the kCFStreamEventEndEncountered event gets
raised after that.
So I'm wondering what causes a kCFStreamEventEndEncountered and
how does it determine that the stream has ended when I'm the one
writing to it? How do I stop it from doing that? And if I cannot, how
can I restart the write stream again without affecting the read
stream?
Regards,
Liwei
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden