CFStreamCreatePairWithSocket(_:_:_:_:)
Creates readable and writable streams connected to a socket.
Declaration
func CFStreamCreatePairWithSocket(_ alloc: CFAllocator!, _ sock: CFSocketNativeHandle, _ 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. - sock:
The pre-existing (and already connected) socket which the socket streams should use.
- readStream:
Upon 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:
Upon 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
Most properties are shared by both streams. Setting a shared property for one stream automatically sets the property for the other.