CFStream

This document describes the generic CFStream functions, data types, and constants. See also CFReadStreamRef and CFWriteStreamRef for functions and constants specific to read and write streams respectively.

Overview

Topics

Creating Streams

CFStreamCreatePairWithPeerSocketSignature

Creates readable and writable streams connected to a socket.

CFStreamCreatePairWithSocketToHost

Creates readable and writable streams connected to a TCP/IP port of a particular host.

CFStreamCreatePairWithSocket

Creates readable and writable streams connected to a socket.

CFStreamCreateBoundPair

Creates a bound pair of read and write streams.

CFStreamCreatePairWithSocketToCFHost

Creates readable and writable streams connected to a given CFHost object.

CFStreamCreatePairWithSocketToNetService

Creates a pair of streams for a CFNetService.

Obtaining Errors

CFSocketStreamSOCKSGetError

This function gets error codes in the kCFStreamErrorDomainSOCKS domain from the CFStreamError returned by a stream operation.

CFSocketStreamSOCKSGetErrorSubdomain

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

Setting the Security Protocol

CFSocketStreamPairSetSecurityProtocol

This function sets the security protocol for the specified pair of socket streams.

Data Types

CFStreamClientContext

A structure that contains program-defined data and callbacks with which you can configure a stream’s client behavior.

Constants

CFStreamStatus

Constants that describe the status of a stream.

CFStreamErrorDomain

Defines constants for values returned in the domain field of the CFStreamError structure.

CFStream Error Domain Constants (CFHost)

Defines constants for values returned in the domain field of the CFStreamError structure.

Error Subdomains

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

Secure Sockets (SOCKS) Errors

Error codes returned by the kCFStreamErrorDomainSOCKS error domain.

CFStreamEventType

Defines constants for stream-related events.

Stream Properties

Stream property names that can be set or copied.

CFStream Property SSL Settings Constants

Constants for use in a CFDictionary object that is the value of the kCFStreamPropertySSLSettings stream property key.

CFStream Socket Security Level Constants

Constants for setting the security level of a socket stream.

CFStream SOCKS Proxy Key Constants

Constants for SOCKS Proxy CFDictionary keys.

Stream Service Types

String constants that specify the service type of a stream.

CFStreamSocketSecurityProtocol

Specifies constants for setting the security protocol for a socket stream.