CFReadStreamRead blocking
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.