Re: iPhone: CFWriteStreamWrite
Re: iPhone: CFWriteStreamWrite
- Subject: Re: iPhone: CFWriteStreamWrite
- From: Jens Alfke <email@hidden>
- Date: Sat, 5 Jul 2008 13:18:09 -0700
I have a problem transferring data using a CFWriteStream at least in the ****** simulator, CFWriteStream does not accept data and blocks forever.
You can't talk about ***** development here without violating your NDA. At least not till next Friday... The callback is called and then I create a read and write stream to the socket using CFStreamCreatePairWithSocket. After that I open a write stream calling CFWriteStreamOpen. And the stream status shows open. But CFWriteStreamCanAcceptBytes returns always false and CFWriteStreamWrite blocks forever.
Did you open the read stream too? (I'm not sure if that's required.) Did you install callbacks on the CFStream too, to get notified when it's ready to write?
You may want to check out the TCPListener and TCPClient classes in my "MYNetwork" library: They're based on the CocoaEcho sample code, but greatly extended. You can subclass these to implement your own protocols, instead of having to re-invent basic TCP support with CFNetwork.
—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