CFStream Socket Additions
| Derived from | |
| Framework | CoreServices |
| Companion guide | |
| Declared in | CFSocketStream.h CFStream.h |
Overview
This document describes the CFStream functions for working with sockets. It is part of the CFSocketStream API.
Functions by Task
Creating Socket Pairs
Obtaining Errors
Functions
CFSocketStreamSOCKSGetError
This function gets error codes in the kCFStreamErrorDomainSOCKS domain from the CFStreamError returned by a stream operation.
SInt32 CFSocketStreamSOCKSGetError(CFStreamError* error);
Parameters
- error
The error value to decode.
Discussion
Error codes in the kCFStreamErrorDomainSOCKS domain can come from multiple parts of the protocol stack, many of which define their own error values as part of outside specifications such as the HTTP specification.
To avoid confusion from conflicting error numbers, error codes in the kCFStreamErrorDomainSOCKS domain contain two parts: a subdomain, which tells which part of the protocol stack generated the error, and the error code itself.
Calling CFSocketStreamSOCKSGetError returns the error code itself, which must be interpreted in the context of the result of a call to CFSocketStreamSOCKSGetErrorSubdomain. Possible return values (beyond subdomain-specific values such as client versions and HTTP error codes) are listed in “CFStream Errors.”
Availability
- Available in iOS 2.0 and later.
Declared In
CFSocketStream.hCFSocketStreamSOCKSGetErrorSubdomain
Gets the error subdomain associated with errors in the kCFStreamErrorDomainSOCKS domain from the CFStreamError returned by a stream operation.
SInt32 CFSocketStreamSOCKSGetErrorSubdomain(CFStreamError* error);
Parameters
- error
The error value to decode.
Discussion
Error codes in the kCFStreamErrorDomainSOCKS domain can come from multiple parts of the protocol stack, many of which define their own error values as part of outside specifications such as the HTTP specification.
To avoid confusion from conflicting error numbers, error codes in the kCFStreamErrorDomainSOCKS domain contain two parts: a subdomain, which tells which part of the protocol stack generated the error, and the error code itself.
Calling CFSocketStreamSOCKSGetErrorSubdomain returns an identifier that tells which layer of the protocol stack produced the error. The possible values are listed in “Error Subdomains.” With this information, you can interpret the error codes returned by CFSocketStreamSOCKSGetError.
Availability
- Available in iOS 2.0 and later.
Declared In
CFSocketStream.hCFStreamCreatePairWithSocketToCFHost
Creates readable and writable streams connected to a given CFHost object.
void CFStreamCreatePairWithSocketToCFHost ( CFAllocatorRef alloc, CFHostRef host, SInt32 port, CFReadStreamRef *readStream, CFWriteStreamRef *writeStream );
Parameters
- alloc
The allocator to use to allocate memory for the
CFReadStreamandCFWriteStreamobjects. PassNULLorkCFAllocatorDefaultto use the current default allocator.- host
A
CFHostobject to which the streams are connected. If unresolved, the host will be resolved prior to connecting.- port
The TCP port number to which the socket streams should connect.
- readStream
Upon return, contains a
CFReadStreamobject connected to the host host on portport, orNULLif there is a failure during creation. If you passNULL, the function will not create a readable stream. Ownership follows the Create Rule.- writeStream
Upon return, contains a
CFWriteStreamobject connected to the host host on portport, orNULLif there is a failure during creation. If you passNULL, the function will not create a writable stream. Ownership follows the Create Rule.
Discussion
The streams do not open a connection to the specified host until one of the streams is opened.
Most properties are shared by both streams. Setting the property for one stream automatically sets the property for the other.
Availability
- Available in iOS 2.0 and later.
Declared In
CFSocketStream.hCFStreamCreatePairWithSocketToNetService
Creates a pair of streams for a CFNetService.
void CFStreamCreatePairWithSocketToNetService ( CFAllocatorRef alloc, CFNetServiceRef service, CFReadStreamRef *readStream, CFWriteStreamRef *writeStream );
Parameters
- alloc
The allocator to use to allocate memory for the
CFReadStreamandCFWriteStreamobjects. PassNULLorkCFAllocatorDefaultto use the current default allocator.- service
Reference to the
CFNetServiceto which the streams are to be connected. If the service is not resolved, the service will be resolved before the streams are connected.- readstream
Upon return, contains a
CFReadStreamobject connected to the service specified by service, orNULLif there is a failure during creation. If you passNULL, the function will not create a readable stream. Ownership follows the Create Rule.- writeStream
Upon return, contains a
CFWriteStreamobject connected to the service specified by service, orNULLif there is a failure during creation. If you passNULL, the function will not create a writable stream. Ownership follows the Create Rule.
Discussion
Read and write operations on sockets can block. To prevent blocking, you can call CFReadStreamSetClient and CFWriteStreamSetClient to register to receive stream-related event notifications. Then call CFReadStreamScheduleWithRunLoop and CFWriteStreamScheduleWithRunLoop to schedule the stream on a run loop for receiving stream-related event notifications. Then call CFReadStreamOpen and CFWriteStreamOpen to open each stream.
Special Considerations
This function is thread safe.
Availability
- Available in iOS 2.0 and later.
Declared In
CFSocketStream.hConstants
CFStream Property Keys
Constants for CFStream property keys
const CFStringRef kCFStreamPropertyShouldCloseNativeSocket; const CFStringRef kCFStreamPropertySocketSecurityLevel; const CFStringRef kCFStreamPropertySOCKSProxy; const CFStringRef kCFStreamPropertySSLPeerCertificates; const CFStringRef kCFStreamPropertySSLPeerTrust; const CFStringRef kCFStreamPropertySSLSettings; const CFStringRef kCFStreamPropertyProxyLocalByPass; const CFStringRef kCFStreamPropertySocketRemoteHost; const CFStringRef kCFStreamPropertySocketRemoteNetService; const CFStringRef kCFStreamNetworkServiceType; const CFStringRef kCFStreamPropertyConnectionIsCellular; const CFStringRef kCFStreamPropertyNoCellular;
Constants
kCFStreamPropertyShouldCloseNativeSocketShould Close Native Socket property key.
If set to
kCFBooleanTrue, the stream will close and release the underlying native socket when the stream is released. If set tokCFBooleanFalse, the stream will not close and release the underlying native socket when the stream is released. If a stream is created with a native socket, the default value of this property iskCFBooleanFalse. This property is only available for socket streams. It can be set by callingCFReadStreamSetPropertyandCFWriteStreamSetProperty, and it can be copied byCFReadStreamCopyPropertyandCFWriteStreamCopyProperty.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamPropertySocketNativeHandleSocket Native Handle property key.
Causes
CFReadStreamCopyPropertyorCFWriteStreamCopyPropertyto returnCFDataobject that contains the native handle for a socket stream. This property is only available for socket streams.Available in iOS 2.0 and later.
Declared in
CFStream.h.kCFStreamPropertySocketSecurityLevelSocket Security Level property key.
See “CFStream Socket Security Level Constants” for specific security level constants to use.
Note: If you set this key, you must do so before setting any other SSL options, such as
kCFStreamPropertySSLSettings.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamPropertySSLPeerCertificatesSSL Peer Certificates property key for copy operations, which return a
CFArrayobject containingSecCertificateRefobjects.For more information, see
SSLGetPeerCertificatesinSecurity/SecureTransport.h.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamPropertySSLPeerTrustSSL Peer Trust property key for copy operations, which return a
SecTrustRefobject containing the result of the SSL handshake.For more information, see
SSLCopyPeerTrustinSecurity/SecureTransport.h.Declared in
CFSocketStream.h.Available in iOS 2.0 and later.
kCFStreamPropertySOCKSProxySOCKS proxy property key.
To set a
CFStreamobject to use a SOCKS proxy, callCFReadStreamSetPropertyorCFWriteStreamSetPropertywith the property name set tokCFStreamPropertySOCKSProxyand its value set to aCFDictionaryobject having at minimum akCFStreamPropertySOCKSProxyHostkey and akCFStreamPropertySOCKSProxyPortkey. For information on these keys, see “CFStream SOCKS Proxy Key Constants.” SystemConfiguration returns a CFDictionary for SOCKS proxies that is usable without modification.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamPropertySSLSettingsSSL Settings property key for set operations.
The key’s value is a
CFDictionaryobject containing security settings. For information on the dictionary’s keys and values, see “CFStream Property SSL Settings Constants.” By default, there are no security settings.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamPropertyProxyLocalBypassProxy Local Bypass property key.
The key’s value is
CFBooleanobject whose value indicates whether local hostnames should be subject to proxy handling.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamPropertySocketRemoteHostThe key’s value is a
CFHostReffor the remote host if it is known. If not, its value isNULL.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamPropertySocketRemoteNetServiceThe key’s value is a
CFNetServiceReffor the remote network service if it is known. If not, its value isNULL.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamNetworkServiceTypeThe type of service for the stream. Providing the service type allows the system to properly handle certain attributes of the stream, including routing and suspension behavior. Most streams do not need to set this property. See
“Stream Service Types”for a list of possible values.Available in iOS 4.0 and later.
Declared in
CFSocketStream.h.kCFStreamPropertyConnectionIsCellularA boolean value indicating whether the stream is connected over a cellular (WWAN) interface. This is a read-only property, and is
falseuntil the connection has been established.Available in iOS 6.0 and later.
Declared in
CFSocketStream.h.kCFStreamPropertyNoCellularA boolean value indicating that the connection should not be established over a cellular (WWAN) connection. This value can be set only before you open the stream.
Available in iOS 6.0 and later.
Declared in
CFSocketStream.h.
Declared In
CFNetwork/CFSocketStream.hCFStream Property SSL Settings Constants
Constants for use in a CFDictionary object that is the value of the kCFStreamPropertySSLSettings stream property key.
const CFStringRef kCFStreamSSLLevel; const CFStringRef kCFStreamSSLAllowsExpiredCertificates; const CFStringRef kCFStreamSSLAllowsExpiredRoots; const CFStringRef kCFStreamSSLAllowsAnyRoot; const CFStringRef kCFStreamSSLValidatesCertificateChain; const CFStringRef kCFStreamSSLPeerName; const CFStringRef kCFStreamSSLCertificates; const CFStringRef kCFStreamSSLIsServer;
Constants
kCFStreamSSLLevelSecurity property key whose value specifies the stream’s security level.
By default, a stream’s security level is
kCFStreamSocketSecurityLevelNegotiatedSSL. For other possible values, see “CFStream Socket Security Level Constants.”Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamSSLAllowsExpiredCertificatesSecurity property key whose value indicates whether expired certificates are allowed.
By default, the value of this key is
kCFBooleanFalse(expired certificates are not allowed).Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamSSLAllowsExpiredRootsSecurity property whose value indicates whether expired root certificates are allowed.
By default, the value of this key is
kCFBooleanFalse(expired root certificates are not allowed).Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamSSLAllowsAnyRootSecurity property key whose value indicates whether root certificates should be allowed.
By default, the value of this key is
kCFBooleanFalse(root certificates are not allowed).Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamSSLValidatesCertificateChainSecurity property key whose value indicates whether the certificate chain should be validated.
By default, the value of this key is
kCFBooleanTrue(the certificate chain should be validated).Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamSSLPeerNameSecurity property key whose value overrides the name used for certificate verification.
By default, the host name that was used when the stream was created is used; if no host name was used, no peer name will be used. Set the value of this key to
kCFNullto prevent name verification.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamSSLCertificatesSecurity property key whose value is a CFArray of SecCertificateRefs except for the first element in the array, which is a SecIdentityRef.
For more information, see
SSLSetCertificate()inSecurity/SecureTransport.h.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamSSLIsServerSecurity property key whose value indicates whether the connection is to act as a server in the SSL process.
By default, the value of this key is
kCFBooleanFalse(the connection is not to act as a server). If the value of this key iskCFBooleanTrue, thekCFStreamSSLCertificateskey must contain a valid value.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.
Discussion
This enumeration defines the constants for keys in a CFDictionary object that is the value of the kCFStreamPropertySSLSettings key.
Declared In
CFNetwork/CFSocketStream.hCFStream Socket Security Protocol Constants
Specifies constants for setting the security protocol for a socket stream.
typedef enum {
kCFStreamSocketSecurityNone = 0,
kCFStreamSocketSecuritySSLv2,
kCFStreamSocketSecuritySSLv3,
kCFStreamSocketSecuritySSLv23,
kCFStreamSocketSecurityTLSv1
} CFStreamSocketSecurityProtocol;
Constants
kCFStreamSocketSecurityNoneSpecifies that no security protocol be set for a socket stream. (Deprecated. Use
kCFStreamSocketSecurityLevelNone.)Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamSocketSecuritySSLv2Specifies that SSL version 2 be set as the security protocol for a socket stream. (Deprecated. Use
kCFStreamSocketSecurityLevelSSLv2.)Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamSocketSecuritySSLv3Specifies that SSL version 3 be set as the security protocol for a socket stream. (Deprecated. Use
kCFStreamSocketSecurityLevelSSLv3.)Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamSocketSecuritySSLv23Specifies that SSL version 3 be set as the security protocol for a socket stream pair. If that version is not available, specifies that SSL version 2 be set as the security protocol for a socket stream. (Deprecated. Use
kCFStreamSocketSecurityLevelNegotiatedSSL.)Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamSocketSecurityTLSv1Specifies that TLS version 1 be set as the security protocol for a socket stream. (Deprecated. Use
kCFStreamSocketSecurityLevelTLSv1.)Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.
Discussion
This enumeration defines constants for setting the security protocol for a socket stream pair when calling CFSocketStreamPairSetSecurityProtocol.
Special Considerations
This enumeration is deprecated in favor of the constants described in “CFStream Socket Security Level Constants.”
Declared In
CFNetwork/CFSocketStream.hCFStream Socket Security Level Constants
Constants for setting the security level of a socket stream.
const CFStringRef kCFStreamSocketSecurityLevelNone; const CFStringRef kCFStreamSocketSecurityLevelSSLv2; const CFStringRef kCFStreamSocketSecurityLevelSSLv3; const CFStringRef kCFStreamSocketSecurityLevelTLSv1; const CFStringRef kCFStreamSocketSecurityLevelNegotiatedSSL;
Constants
kCFStreamSocketSecurityLevelNoneSpecifies that no security level be set.
Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamSocketSecurityLevelSSLv2Specifies that SSL version 2 be set as the security protocol for a socket stream.
Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamSocketSecurityLevelSSLv3Specifies that SSL version 3 be set as the security protocol for a socket stream pair.
If SSL version 3 is not available, specifies that SSL version 2 be set as the security protocol for a socket stream.
Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamSocketSecurityLevelTLSv1Specifies that TLS version 1 be set as the security protocol for a socket stream.
Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamSocketSecurityLevelNegotiatedSSLSpecifies that the highest level security protocol that can be negotiated be set as the security protocol for a socket stream.
Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.
Discussion
This enumeration defines the preferred constants for setting the security protocol for a socket stream pair when calling CFReadStreamSetProperty or CFWriteStreamSetProperty.
Declared In
CFNetwork/CFSocketStream.hCFStream SOCKS Proxy Key Constants
Constants for SOCKS Proxy CFDictionary keys.
const CFStringRef kCFStreamPropertySOCKSProxyHost; const CFStringRef kCFStreamPropertySOCKSProxyPort; const CFStringRef kCFStreamPropertySOCKSVersion; const CFStringRef kCFStreamSocketSOCKSVersion4; const CFStringRef kCFStreamSocketSOCKSVersion5; const CFStringRef kCFStreamPropertySOCKSUser; const CFStringRef kCFStreamPropertySOCKSPassword;
Constants
kCFStreamPropertySOCKSProxyHostConstant for the SOCKS proxy host key.
This key contains a CFString object that represents the SOCKS proxy host. Defined to match
kSCPropNetProxiesSOCKSProxy.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamPropertySOCKSProxyPortConstant for the SOCKS proxy host port key.
This key contains a
CFNumberRefobject of typekCFNumberSInt32Typewhose value represents the port on which the proxy listens.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamPropertySOCKSVersionConstant for the SOCKS version key.
Its value must be
kCFStreamSocketSOCKSVersion4orkCFStreamSocketSOCKSVersion5to set SOCKS4 or SOCKS5, respectively. If this key is not present, SOCKS5 is used by default.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamSocketSOCKSVersion4Constant used in the
kCFStreamSockerSOCKSVersionkey to specify SOCKS4 as the SOCKS version for the stream.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamSocketSOCKSVersion5Constant used in the
kCFStreamSOCKSVersionkey to specify SOCKS5 as the SOCKS version for the stream.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamPropertySOCKSUserConstant for the key required to set a user name.
The value is a
CFStringobject containing the user’s name.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamPropertySOCKSPasswordConstant for the key required to set a user’s password.
The value is a
CFStringobject containing the user’s password.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.
Discussion
When setting the stream's SOCKS Proxy property, the property’s value is a CFDictionary object containing at minimum the kCFStreamPropertySOCKSProxyHost and kCFStreamPropertySOCKSProxyPort keys. The dictionary may also contain the other keys described in this section.
Stream Service Types
String constants that specify the service type of a stream.
CFStringRef const kCFStreamNetworkServiceTypeVoIP;
Constants
kCFStreamNetworkServiceTypeVoIPSpecifies that the stream is providing VoIP service.
Available in iOS 4.0 and later.
Declared in
CFSocketStream.h.
Error Domains
Error domains specific to CFSocketStream calls.
extern const int kCFStreamErrorDomainSOCKS; extern const int kCFStreamErrorDomainSSL; extern const CFIndex kCFStreamErrorDomainWinSock;
Constants
kCFStreamErrorDomainSOCKSThis domain returns error codes from the SOCKS layer. The errors are described in
Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamErrorDomainSSLThis domain returns error codes associated with the SSL layer. For a list of error codes, see the header
SecureTransport.hinSecurity.framework.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamErrorDomainWinSockWhen running CFNetwork code on Windows, this domain returns error codes associated with the underlying TCP/IP stack. You should also note that non-networking errors such as
ENOMEMare delivered through the POSIX domain. See the headerwinsock2.hfor relevant error codes.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.
Discussion
To determine the source of an error, examine the userInfo dictionary included in the CFError object returned by a function call or call CFErrorGetDomain and pass in the CFError object and the domain whose value you want to read.
Error Subdomains
Subdomains used to determine how to interpret an error in the kCFStreamErrorDomainSOCKS domain.
enum {
kCFStreamErrorSOCKSSubDomainNone = 0,
kCFStreamErrorSOCKSSubDomainVersionCode = 1,
kCFStreamErrorSOCKS4SubDomainResponse = 2,
kCFStreamErrorSOCKS5SubDomainUserPass = 3,
kCFStreamErrorSOCKS5SubDomainMethod = 4,
kCFStreamErrorSOCKS5SubDomainResponse = 5
};
Constants
kCFStreamErrorSOCKSSubDomainNoneThe error code returned is a SOCKS error number.
kCFStreamErrorSOCKSSubDomainVersionCodeThe error returned contains the version of SOCKS that the server wishes to use.
kCFStreamErrorSOCKS4SubDomainResponseThe error returned is the status code that the server returned after the last operation.
kCFStreamErrorSOCKS5SubDomainUserPassThis subdomain returns error codes associated with the last authentication attempt.
kCFStreamErrorSOCKS5SubDomainMethodThis subdomain returns the server’s desired negotiation method.
kCFStreamErrorSOCKS5SubDomainResponseThis subdomain returns the response code sent by the server when replying to a connection request.
Discussion
Error codes in the kCFStreamErrorDomainSOCKS domain can come from multiple parts of the protocol stack, many of which define their own error values as part of outside specifications such as the HTTP specification.
To avoid confusion from conflicting error numbers, error codes in the kCFStreamErrorDomainSOCKS domain contain two parts: a subdomain, which tells which part of the protocol stack generated the error, and the error code itself.
Calling CFSocketStreamSOCKSGetErrorSubdomain returns an identifier that tells which layer of the protocol stack produced the error. This list of constants contains the possible values that this function will return.
Calling CFSocketStreamSOCKSGetError returns the actual error code that the subdomain describes.
CFStream Errors
Error codes returned by the kCFStreamErrorDomainSOCKS error domain.
/* kCFStreamErrorSOCKSSubDomainNone*/
enum {
kCFStreamErrorSOCKS5BadResponseAddr = 1,
kCFStreamErrorSOCKS5BadState = 2,
kCFStreamErrorSOCKSUnknownClientVersion = 3
};
/* kCFStreamErrorSOCKS4SubDomainResponse*/
enum {
kCFStreamErrorSOCKS4RequestFailed = 91,
kCFStreamErrorSOCKS4IdentdFailed = 92,
kCFStreamErrorSOCKS4IdConflict = 93
};
/* kCFStreamErrorSOCKS5SubDomainMethod*/
enum {
kSOCKS5NoAcceptableMethod = 0xFF
};
Constants
kCFStreamErrorSOCKS5BadResponseAddrThe address returned is not of a known type. This error code is only valid for errors in the
kCFStreamErrorSOCKSSubDomainNonesubdomain.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamErrorSOCKS5BadStateThe stream is not in a state that allows the requested operation. This error code is only valid for errors in the
kCFStreamErrorSOCKSSubDomainNonesubdomain..Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamErrorSOCKSUnknownClientVersionThe SOCKS server rejected access because it does not support connections with the requested SOCKS version. SOCKS client version. You can query the
kCFSOCKSVersionKeykey to find out what version the server requested. This error code is only valid for errors in thekCFStreamErrorSOCKSSubDomainNonesubdomain.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamErrorSOCKS4RequestFailedRequest rejected by the server or request failed. This error is specific to SOCKS4. This error code is only valid for errors in the
kCFStreamErrorSOCKS4SubDomainResponsesubdomain.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamErrorSOCKS4IdentdFailedRequest rejected by the server because it could not connect to the
identddaemon on the client. This error is specific to SOCKS4. This error code is only valid for errors in thekCFStreamErrorSOCKS4SubDomainResponsesubdomain.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kCFStreamErrorSOCKS4IdConflictRequest rejected by the server because the client program and the
identddaemon reported different user IDs. This error is specific to SOCKS4. This error code is only valid for errors in thekCFStreamErrorSOCKS4SubDomainResponsesubdomain.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.kSOCKS5NoAcceptableMethodThe client and server could not find a mutually agreeable authentication method. This error code is only valid for errors in the
kCFStreamErrorSOCKS5SubDomainMethodsubdomain.Available in iOS 2.0 and later.
Declared in
CFSocketStream.h.
Discussion
Error codes in the kCFStreamErrorDomainSOCKS domain can come from multiple parts of the protocol stack, many of which define their own error values as part of outside specifications such as the HTTP specification.
To avoid confusion from conflicting error numbers, error codes in the kCFStreamErrorDomainSOCKS domain contain two parts: a subdomain, which tells which part of the protocol stack generated the error, and the error code itself.
Calling CFSocketStreamSOCKSGetErrorSubdomain returns an identifier that tells which layer of the protocol stack produced the error.
Calling CFSocketStreamSOCKSGetError returns the actual error code that the subdomain describes. This list of constants contains the possible values that this function will return. They must be interpreted within the context of the relevant error subdomain.
© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-12-13)