• 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
CFReadStreamRead blocking
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CFReadStreamRead blocking


  • Subject: CFReadStreamRead blocking
  • From: David Watanabe <email@hidden>
  • Date: Wed, 29 May 2002 18:13:49 -0700

Hi,

I'm working on a network program that maintains ~10 socket connections at any given time, and I am using the CFStream APIs to get callbacks in the runloop since it greatly simplifies my UI and protocol code (no synchronization issues). However, I'm running into a problem with CFReadStreamRead.

I am occasionally seeing (using Thread Viewer) the main runloop blocking on a read, even though I only ever invoke CFReadStreamRead after a kCFStreamEventHasBytesAvailable event has arrived. I even take the (redundant) step of checking via CFStreamEventHasBytesAvailable() before performing the read, but I still see main thread block from time to time.

This blocking is somewhat rare, and it doesn't seem to correspond to any weird state (like an error) of the stream. The stream is open and continues to produce valid data after the block.

Is this a known issue and is there a workaround? I realize I could just put the read in a thread, but that sort of negates the benefits of the CFStream APIs.

Thanks,
David Watanabe
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: CFReadStreamRead blocking
      • From: Becky Willrich <email@hidden>
References: 
 >Re: CFStream bugs? (was Re: CFNetwork Website) (From: Becky Willrich <email@hidden>)

  • Prev by Date: Re: Changing MTU?
  • Next by Date: Re: CFReadStreamRead blocking
  • Previous by thread: Re: CFStream bugs? (was Re: CFNetwork Website)
  • Next by thread: Re: CFReadStreamRead blocking
  • Index(es):
    • Date
    • Thread