Dispatch I/O

An object that manages operations on a file descriptor using either stream-based or random-access semantics.

Topics

Creating a Dispatch I/O Object

dispatch_io_create

Creates a dispatch I/O channel and associates it with the specified file descriptor.

dispatch_io_create_with_io

Creates a new dispatch I/O channel from an existing channel.

dispatch_io_create_with_path

Creates a dispatch I/O channel with the associated path name.

dispatch_io_t

A dispatch I/O channel.

dispatch_fd_t

A file descriptor used for I/O operations.

dispatch_io_type_t

The type of a dispatch I/O channel.

Reading from the File

dispatch_read

Schedules an asynchronous read operation using the specified file descriptor.

dispatch_io_read

Schedules an asynchronous read operation on the specified channel.

dispatch_io_handler_t

A handler block used to process operations on a dispatch I/O channel.

Writing to the File

dispatch_write

Schedules an asynchronous write operation using the specified file descriptor.

dispatch_io_write

Schedules an asynchronous write operation for the specified channel.

Closing the File

dispatch_io_close

Closes the specified channel to new read and write operations.

dispatch_io_close_flags_t

Additional flags to use when closing an I/O channel.

Managing the File Descriptor

dispatch_io_get_descriptor

Returns the file descriptor associated with the specified channel.

dispatch_io_set_interval

Sets the interval (in nanoseconds) at which to invoke the I/O handlers for the channel.

dispatch_io_interval_flags_t

The type for flags used to specify the dispatch interval of a channel.

dispatch_io_set_low_water

Sets the minimum number of bytes to process before enqueueing a handler block.

dispatch_io_set_high_water

Sets the maximum number of bytes to process before enqueueing a handler block.

Synchronizing File Operations

dispatch_io_barrier

Schedules a barrier operation on the specified channel.

See Also

System Event Monitoring

Dispatch Source

An object that coordinates the processing of specific low-level system events, such as file-system events, timers, and UNIX signals.

Dispatch Data

An object that manages a memory-based data buffer and exposes it as a contiguous block of memory.