• 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
CFReadStream not giving me any data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CFReadStream not giving me any data


  • Subject: CFReadStream not giving me any data
  • From: Dave Camp <email@hidden>
  • Date: Tue, 24 Feb 2004 11:34:19 -0800

I'm prototyping some CFStream code that will use unix domain sockets to communicate between two processes. For testing, I've got a server app and a client app. The sequence of events looks something like:

- Server creates socket with CFSocketCreateWithSocketSignature
- Client connects with:
CFSocketCreateConnectedToSocketSignature
CFStreamCreatePairWithSocket
CFReadStreamSetClient(
kCFStreamEventOpenCompleted | kCFStreamEventHasBytesAvailable |
kCFStreamEventErrorOccurred | kCFStreamEventEndEncountered)
CFReadStreamScheduleWithRunLoop(readStreamRef, CFRunLoopGetCurrent(), kCFRunLoopCommonModes);
CFReadStreamOpen
CFWriteStreamOpen

- Server accept callback is called and it does:
CFStreamCreatePairWithSocket
CFReadStreamSetClient(
kCFStreamEventOpenCompleted | kCFStreamEventHasBytesAvailable |
kCFStreamEventErrorOccurred | kCFStreamEventEndEncountered)
CFReadStreamScheduleWithRunLoop(readStreamRef, CFRunLoopGetCurrent(), kCFRunLoopCommonModes);
CFReadStreamOpen
CFWriteStreamOpen

- Client and Server callbacks are both called with kCFStreamEventOpenCompleted

- Server writes a string with CFWriteStreamWrite

And that's about where it ends. The client is never called with kCFStreamEventHasBytesAvailable. At this point, both apps are sitting idle in their runloops waiting for something to happen. No errors are detected on any of the calls leading to this point.

If I kill the client, the server gets kCFStreamEventHasBytesAvailable with zero bytes and kCFStreamEventEndEncountered, as expected. I can also successfully write from the client to the server. If I kill the server first, the client does not get any callbacks. It's as if the pipes are only open one way or something.

Any thoughts on why the client would get a kCFStreamEventOpenCompleted, but no further messages?

Dave
---
The path of least resistance, it's not just for electricity any more.
_______________________________________________
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: CFReadStream not giving me any data
      • From: Jeremy Wyld <email@hidden>
  • Prev by Date: Re: Copying files >2GB
  • Next by Date: WSMethodInvocation & WS-Security
  • Previous by thread: Re: OTSnd() weirdness
  • Next by thread: Re: CFReadStream not giving me any data
  • Index(es):
    • Date
    • Thread