SelectionKey

The SelectionKey struct holds the information concerning the conduits and their association to a selector. Each key keeps a reference to a registered conduit and the events that are to be tracked for it. The 'events' member of the key can take two meanings, depending on where it's used. If used with the register() method of the selector it represents the events we want to track; if used within a foreach cycle on an ISelectionSet it represents the events that have been detected for a conduit.

The SelectionKey can also hold an optional object via the 'attachment' member. This member is very convenient to keep application-specific data that will be needed when the tracked events are triggered.

Members

Functions

isError
bool isError()

Check if an Error event has been associated to this SelectionKey.

isHangup
bool isHangup()

Check if a Hangup event has been associated to this SelectionKey.

isInvalidHandle
bool isInvalidHandle()

Check if an InvalidHandle event has been associated to this SelectionKey.

isReadable
bool isReadable()

Check if a Read event has been associated to this SelectionKey.

isUrgentRead
bool isUrgentRead()

Check if an UrgentRead event has been associated to this SelectionKey.

isWritable
bool isWritable()

Check if a Write event has been associated to this SelectionKey.

Variables

attachment
Object attachment;

The attached Object referred to by the SelectionKey.

conduit
ISelectable conduit;

The conduit referred to by the SelectionKey.

events
Event events;

The registered (or selected) events as a bit mask of different Event values.

See Also

$(SYMLINK ISelector, ISelector), $(SYMLINK ISelectionSet, ISelectionSet)

Meta