Re: Questions related to CFHostSetClient, CFStreamError, deprecation and error code
Re: Questions related to CFHostSetClient, CFStreamError, deprecation and error code
- Subject: Re: Questions related to CFHostSetClient, CFStreamError, deprecation and error code
- From: Stéphane Sudre <email@hidden>
- Date: Tue, 03 Jul 2012 08:47:58 +0000
- Acceptlanguage: en-US
- Thread-topic: Questions related to CFHostSetClient, CFStreamError, deprecation and error code
On Jul 2, 2012, at 3:18 PM, Quinn The Eskimo! wrote:
>
> On 2 Jul 2012, at 12:16, Stéphane Sudre wrote:
>
>> Question #1:
>>
>> According to some headers directly accessing the domain and error values of CFStreamError is deprecated and one should use one of the provided CFRead/WriteStreamCopyError functions.
>
> Yeah, that comment only applies to CF/NSStream, where there's new API for getting a CF/NSError. For places that use CFStreamError and don't provide an equivalent (CFHost is one, NSNetService is another), you must continue to use the old school errors.
>
> I'd appreciate you filing a bug against CFHost to get a better error reporting mechanism. CFStreamError is un-fun.
>
> <http://developer.apple.com/bugreporter/>
Done.
Bug ID# 11795905
>> Question #2:
>>
>> Where are the error codes defined for the CFHostRef API?
>
> There are two error domains that come from CFStream, kCFStreamErrorDomainPOSIX and kCFStreamErrorDomainMacOSStatus. CFNetwork defines a bunch of others.
>
> $ grep -r -i "CFN_EXPORT const SInt32" .
> ./CFFTPStream.h:CFN_EXPORT const SInt32 kCFStreamErrorDomainFTP __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0);
> ./CFHost.h:CFN_EXPORT const SInt32 kCFStreamErrorDomainNetDB __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0);
> ./CFHost.h:CFN_EXPORT const SInt32 kCFStreamErrorDomainSystemConfiguration __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0);
> ./CFHTTPStream.h:CFN_EXPORT const SInt32 kCFStreamErrorDomainHTTP __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0);
> ./CFNetServices.h:CFN_EXPORT const SInt32 kCFStreamErrorDomainMach __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0);
> ./CFNetServices.h:CFN_EXPORT const SInt32 kCFStreamErrorDomainNetServices __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0);
>
> In most cases the place where the error is defined also defines the error codes.
>
> The domain most relevant to CFHost is kCFStreamErrorDomainNetDB. These error codes come from <sys/netdb.h>.
Thanks, I found the one I was looking for: EAI_NONAME in <netdb.h>
_______________________________________________
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