<!--
{
  "documentType" : "article",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/error-subdomains",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Error Subdomains"
}
-->

# Error Subdomains

Subdomains used to determine how to interpret an error in the `kCFStreamErrorDomainSOCKS` domain.

## 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 <doc://com.apple.documentation/documentation/CFNetwork/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 <doc://com.apple.documentation/documentation/CFNetwork/CFSocketStreamSOCKSGetError(_:)> returns the actual error code that the subdomain describes.

## Topics

### Constants

  <doc://com.apple.documentation/documentation/CFNetwork/kCFStreamErrorSOCKSSubDomainNone>

  <doc://com.apple.documentation/documentation/CFNetwork/kCFStreamErrorSOCKSSubDomainVersionCode>

  <doc://com.apple.documentation/documentation/CFNetwork/kCFStreamErrorSOCKS4SubDomainResponse>

  <doc://com.apple.documentation/documentation/CFNetwork/kCFStreamErrorSOCKS5SubDomainUserPass>

  <doc://com.apple.documentation/documentation/CFNetwork/kCFStreamErrorSOCKS5SubDomainMethod>

  <doc://com.apple.documentation/documentation/CFNetwork/kCFStreamErrorSOCKS5SubDomainResponse>



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)