Re: What causes a kCFStreamEventEndEncountered
Re: What causes a kCFStreamEventEndEncountered
- Subject: Re: What causes a kCFStreamEventEndEncountered
- From: Jens Alfke <email@hidden>
- Date: Sun, 13 Jul 2008 11:29:36 -0700
On 13 Jul '08, at 11:13 AM, Liwei wrote: I have a feeling that as long as the stream manages to write everything I've sent it when kCFStreamEventCanAcceptBytes is brought up, it considers the stream to be at its end. Then it looks like I can only use streams in a "transactional" way, like how its being used in CFFTP and CFHTTP.
No, that's not true. The stream will stay open until one side or the other closes the socket.
Check your code to make sure you're really getting the end-encountered call. It might be misinterpreting the flag bits, or falling through a case, or something like that.
You may also want to check out Apple's CocoaEcho sample code, or my MYNetwork library, which is a descendant of it. (The latter includes abstract TCPListener and TCPClient classes, which take care of the stream details for you.)
—Jens |
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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