CFStreamCreatePairWithPeerSocketSignature(_:_:_:_:)
Creates readable and writable streams connected to a socket.
Declaration
func CFStreamCreatePairWithPeerSocketSignature(_ alloc: CFAllocator!, _ signature: UnsafePointer<CFSocketSignature>!, _ readStream: UnsafeMutablePointer<Unmanaged<CFReadStream>?>!, _ writeStream: UnsafeMutablePointer<Unmanaged<CFWriteStream>?>!)Parameters
- alloc:
The allocator to use to allocate memory for the new objects. Pass
NULLor Kcfallocatordefault to use the current default allocator. - signature:
A Cfsocketsignature structure identifying the communication protocol and address to which the socket streams should connect.
- readStream:
On return, a readable stream connected to the socket address in
signature. If you passNULL, this function will not create a readable stream. Ownership follows the 20001148 103029. - writeStream:
On return, a writable stream connected to the socket address in
signature. If you passNULL, this function will not create a writable stream. Ownership follows the 20001148 103029.
Discussion
The streams do not create a socket or connect to the remote host until you open one of the streams.
Most properties are shared by both streams. Setting a shared property for one stream automatically sets the property for the other.