Re: Qestions about CFHTTP: asynchronous communication mechanism
Re: Qestions about CFHTTP: asynchronous communication mechanism
- Subject: Re: Qestions about CFHTTP: asynchronous communication mechanism
- From: Jeremy Wyld <email@hidden>
- Date: Mon, 6 Dec 2004 08:35:49 -0800
Depending what you mean by "non-existing" the error may vary a little.
In the case of the host not existing, the domain will be equal to
kCFStreamErrorDomainNetDB and error will be one of those listed in
netdb.h (probably EAI_NODATA). In the case the host is there but there
is no server, domain will be equal to kCFStreamErrorDomainPOSIX and the
error will be one of those listed in sys/errno.h (probably
ECONNREFUSED).
SSL errors work in the same manner. The domain will be equal to
kCFStreamErrorDomainSSL and the error will be one of those listed in
Security/SecureTransport.h. In your case, an expired certificate error
would be errSSLCertExpired.
jeremy
On Dec 6, 2004, at 12:09 AM, Alex Guo wrote:
Re: Qestions about CFHTTP: asynchronous communication mech>A
CFHTTPStream is
layered on top of the CFStream base 'class'. Each CFStream has a
status
value, of type CFStreamStatus (in ><CoreFoundation/CFStream.h>). You
can
get the current status of a stream using CFRead/WriteStreamGetStatus.
You
can ask to be notified of status changes >by installing the stream on
your
runloop. This involves:
o calling CFRead/WriteStreamSetClient to specify your callback
function and
what events you're interested in; these events are defined by
CFStreamEventType >and include kCFStreamEventOpenCompleted,
kCFStreamEventHasBytesAvailable, and kCFStreamEventCanAcceptBytes
o calling CFReadStreamScheduleWithRunLoop to install your stream on
the
runloop so that it can call your callback
Thank you very much for your support.
I now understand the mechanism.
My guess is that this is less fine-grained than you were looking for;
can
you tell us what sort of events you're interested in?
1. If the web server is non-existing, how can I tell it by interpret
the
error code ?
2. If the SSL certificate error (such as expiration), how do I know
that?
_______________________________________________
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