Closes the specified channel to new read and write operations.
- iOS 5.0+
- macOS 10.7+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
The channel to close.
The options to use when closing the channel. For a list of possible values, see
_io _close _flags _t
After calling this function, you should not schedule any more read or write operations on the channel. Doing so causes an error to be sent to your handler.
DISPATCH option is specified in the
flags parameter, the system attempts to interrupt any outstanding read and write operations on the I/O channel. Even if you specify this flag, the corresponding handlers may be invoked with partial results. In addition, the final invocation of the handler is passed the
ECANCELED error code to indicate that the operation was interrupted. If you do not specify the
DISPATCH flag, read and write operations on the channel run to completion as normal.