init(type:io:queue:cleanupHandler:)
Creates a new I/O channel from an existing I/O channel.
Declaration
convenience init(type: DispatchIO.StreamType, io: DispatchIO, queue: DispatchQueue, cleanupHandler: @escaping (Int32) -> Void)Parameters
- type:
The access semantics for the channel. For a list of possible values, see Streamtype.
- io:
An existing channel.
- queue:
The dispatch queue on which to perform work.
- cleanupHandler:
The handler to execute once the channel is closed. This block has no return value and takes the following parameter:
- error
An
errnocondition if creating or opening the channel failed; otherwise, the value is0.