• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
What causes a kCFStreamEventEndEncountered
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: What causes a kCFStreamEventEndEncountered
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: iPhone: CFWriteStreamWrite
  • Next by Date: Re: What causes a kCFStreamEventEndEncountered
  • Previous by thread: Using pcap or tcpdump kills the wireless network
  • Next by thread: Re: What causes a kCFStreamEventEndEncountered
  • Index(es):
    • Date
    • Thread