Contents

CFSocketStreamSOCKSGetErrorSubdomain(_:)

Gets the error subdomain associated with errors in the kCFStreamErrorDomainSOCKS domain from the CFStreamError returned by a stream operation.

Declaration

func CFSocketStreamSOCKSGetErrorSubdomain(_ error: UnsafePointer<CFStreamError>) -> Int32

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 under Data Types in CFStream. With this information, you can interpret the error codes returned by CFSocketStreamSOCKSGetError(_:).

See Also

Streams