Re: Write stream proxy
Re: Write stream proxy
- Subject: Re: Write stream proxy
- From: "Philip D. Wasson" <email@hidden>
- Date: Fri, 19 Sep 2008 16:47:29 -0400
On Sep 19, 2008, at 16:22, Jack Brindle wrote:
When creating a new stream from the same http message, do we need to
recreate the read and write streams that are combined into the
CFReadStreamCreateForStreamedHTTPRequest? In other words, when the
output
stream from the CFReadStreamCreateForStreamedHTTPRequest is released
during
the process, are the read and write streams I am using also released?
I suspect the answer is yes, and this one step is what is keeping my
code
from working.
I now believe that when creating the new stream during the
authentication
process I will need to also create the paired read and write
streams, then
feed the new ones to the CFReadStreamCreateForStreamedHTTPRequest.
Even though the docs in Xcode (2.5) don't appear to explicitly say so,
I believe my previous investigations revealed that
CFReadStreamCreateForStreamedHTTPRequest retains the read stream you
give it for the requestBody (which is why I showed releasing that
stream immediately after calling
CFReadStreamCreateForStreamedHTTPRequest. So once you close the reply
read stream, or perhaps even sooner, it will release the request body
read stream. It doesn't have a reference to the write stream, so you
must release that yourself.
So yes, you should re-create the stream pair used to read the file and
supply it to CFReadStreamCreateForStreamedHTTPRequest.
----------------------------------------
Philip D. Wasson
email@hidden
_______________________________________________
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