Contents

FileHandle.DataAvailableMessage

A message a file handle sends when it determines data is available for reading from a file or communications channel.

Declaration

struct DataAvailableMessage

Overview

Before adding an observer for this message type, call either waitForDataInBackgroundAndNotify() or waitForDataInBackgroundAndNotify(forModes:) on an appropriate FileHandle object.

Observe this message with the identifier dataAvailable, or specify its type directly to the addObserver(of:for:using:) method. The Subject of this message type is FileHandle.

This message interoperates with the notification NSFileHandleDataAvailable. The system notifies observers of the message when the NotificationCenter posts the notification. Similarly, the system notifies observers of the notification when it posts the message.

Topics

Creating a message

See Also

Working with notification messages