Re: Overlapping requests on multiple persistent connections?
Re: Overlapping requests on multiple persistent connections?
- Subject: Re: Overlapping requests on multiple persistent connections?
- From: Jim Luther <email@hidden>
- Date: Sat, 29 Nov 2008 08:30:33 -0800
Mike,
I had the same problem with multiple persistent connections when I
brought the WebDAV file system up on CFNetwork. The trick is to make
each CFReadStream unique so that CFNetwork's connection cache won't
try to queue up your new request on a persistent connection it already
has open. This is pretty easy -- just create a unique CFString (or
number) value for each persistent connection you want and then set
that value as a property on the CFReadStream after you create it but
before you open it. For example:
newReadStreamRef = CFReadStreamCreateForHTTPRequest
(kCFAllocatorDefault, request);
/* add persistent property */
CFReadStreamSetProperty(newReadStreamRef,
kCFStreamPropertyHTTPAttemptPersistentConnection, kCFBooleanTrue);
/* make the read stream unique */
CFReadStreamSetProperty(newReadStreamRef, CFSTR("UniqueProperty"),
uniqueValue);
- Jim
On Nov 28, 2008, at 7:58 AM, Michael Bernardo wrote:
I'm trying to use the CFNetwork APIs to make multiple simultaneous
HTTP POST requests to a web service using persistent connections.
I've followed the model used by sample code at "/Developer/Examples/
Networking/Get Example" to get a single persistent connection
working. I can verify that with single, serial requests, the
connection is re-used.
The trouble starts when I try to send simultaneous overlapping
requests. It seems that CFNetwork only creates a single underlying
network connection, no matter how many simultaneous requests are
outstanding.
Is this expected behavior? Is there any way to get multiple
persistent connections created?
TIA,
Mike Bernardo
_______________________________________________
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
_______________________________________________
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