Strange CFStreamError from CFReadStreamCreateForHTTPRequest
Strange CFStreamError from CFReadStreamCreateForHTTPRequest
- Subject: Strange CFStreamError from CFReadStreamCreateForHTTPRequest
- From: Dave Camp <email@hidden>
- Date: Fri, 29 Aug 2003 16:13:40 -0700
I'm working on some code to retrieve data from an HTTP server and my
read stream callback is getting kCFStreamEventOpenCompleted, and then
kCFStreamEventErrorOccurred. I then call CFReadStreamGetError and get a
domain of 4, and an error of -1. I've double checked that several times
in the debugger, so I'm sure thats right. What is domain 4? I can't
seem to find anything like that in the headers...
The code (which I have inherited) essentially looks like (abbreviated
for clarity):
CFReadStreamCreateForHTTPRequest(kCFAllocatorDefault, httpRequest)
CFStreamClientContext clientContext = { 0, (void*)self, nil, nil, nil };
CFOptionFlags clientEvents = kCFStreamEventOpenCompleted
| kCFStreamEventHasBytesAvailable
| kCFStreamEventEndEncountered
| kCFStreamEventErrorOccurred;
CFReadStreamSetClient(readStream, clientEvents,
StaticReadStreamClientCallBack, &clientContext)
CFReadStreamScheduleWithRunLoop(readStream, httpRunLoop,
gHTTPTransactionMode);
CFReadStreamOpen(readStream)
CFRunLoopRunInMode(gHTTPTransactionMode, 1.0e10, false);
This code works fine for several preceding transactions, but fails on
this one. The only unique thing is that I'm getting back more data on
this call (about 3K). Using tcpdump I see the request go to the server,
and the 3K of data coming back, but then I get that odd error in my
callback.
Any thoughts?
Thanks,
Dave
---
It's not denial. I'm just very particular about the reality I choose to
accept. -Calvin
_______________________________________________
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.