Unable to get concurrent CFHTTPStreams...
Unable to get concurrent CFHTTPStreams...
- Subject: Unable to get concurrent CFHTTPStreams...
- From: Michael Ledford <email@hidden>
- Date: Sun, 22 Feb 2009 19:24:16 -0500
Hello,
I have written a cocoa object that acts as a 'network operation' and
uses a CFReadStreamRef as created by either
CFReadStreamCreateForHTTPRequest() or
CFReadStreamCreateForStreamedHTTPRequest(). I am, for the moment, not
using persistent HTTP connections.
I setup the client context and read stream client to look similar to
this...
CFStreamClientContext clientContext = {0, self, NULL, NULL, NULL};
CFReadStreamSetClient(httpOperationReadStream,
(kCFStreamEventOpenCompleted | kCFStreamEventHasBytesAvailable |
kCFStreamEventEndEncountered | kCFStreamEventErrorOccurred),
ReadStreamClientCallBack, &clientContext);
The read stream client callback is a static function of the class that
calls into the correct operation instance using the info context
passed into the callback.
I then schedule the stream on the main run loop like this...
CFReadStreamScheduleWithRunLoop(httpOperationReadStream,
CFRunLoopGetMain(), kCFRunLoopCommonModes);
Then of course I open the stream...
CFReadStreamOpen(httpOperationReadStream);
I will put several of these operations objects in flight one after
another, however only one stream is ever active at a time as shown by
logging and other network monitoring utilities. I am fairly sure that
I should be able to have several of these in flight at a time without
creating multiple threads. Therefore I am wondering, what am I doing
wrong? Why might I only be able to get one HTTP operation active at a
time?
Thanks,
Michael
_______________________________________________
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