PairedStream
class PairedStream
This is a convenience class to tie input and output streams together. If a tunnel with multiple hops is established, each hop will have separate input and output streams.
The API is similar to the Stream
class.
-
The input stream.
Declaration
Swift
let input: WrappedInputStream
-
The output stream.
Declaration
Swift
let output: WrappedOutputStream
-
Create a paired stream from an input and an output stream.
See
Declaration
Swift
init(input: WrappedInputStream, output: WrappedOutputStream)
Parameters
input
The input stream.
output
The output stream.
-
Open both streams.
See
Stream.open()
Declaration
Swift
func open()
-
Close both streams.
See
Stream.close()
Declaration
Swift
func close()
-
Get or set the delegate for both streams.
See
Stream.delegate
Declaration
Swift
var delegate: StreamDelegate? { get set }
-
Schedule both streams in a given run loop for a given mode.
Declaration
Swift
func schedule(in runLoop: RunLoop, forMode mode: RunLoop.Mode)
Parameters
runLoop
The run loop.
mode
The run loop mode.