Re: What causes a kCFStreamEventEndEncountered
Re: What causes a kCFStreamEventEndEncountered
- Subject: Re: What causes a kCFStreamEventEndEncountered
- From: Liwei <email@hidden>
- Date: Mon, 14 Jul 2008 02:51:23 +0800
Okay, I've just did a quick check and you're right, I could have
changed some stuff that caused it stop encountering a stream end.
However, I am still unable to write to the stream after my run loop
starts.
Further checking shows that after it finishes sending stuff that I
have written to its buffer before the start of the run loop, it
somehow unscheduled itself form the run loop. The call back function
stopped being called.
The last time it calls the call back function, nothing is done since
there is no data to be sent. Then it stopped being called.
I'll check out the sample code and your library, your library sounds
like what I need, good...
2008/7/14 Jens Alfke <email@hidden>:
>
> 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
_______________________________________________
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