Module Interface IO:Select

SUMMARY: MODULE | CLASS | TYPE | PROC | VAR | CONST | DETAIL: TYPE | PROC | VAR | CONST

# IO:Select

### Import List

        IO
        Object
        Object

Class List
SelectionKey |
Selector |

Class Summary: SelectionKey [Detail]
      +---Object.Object
           |
           +---IO.SelectionKey
                |
                +--IO:Select.SelectionKey
Inherited Fields
From IO.SelectionKey: attachment, channel, fd, interestOps, nextKey, selector
Inherited Methods
From Object.Object: Equals, HashCode, ToString From IO.SelectionKey: Attach, Cancel, SetInterestOps

Class Summary: Selector [Detail]
      +---Object.Object
           |
           +---IO.Selector
                |
                +--IO:Select.Selector
Inherited Fields
From IO.Selector: keys
Constructor Summary
Init(Selector)
Open(): Selector
Method Summary
AddSelectionKey(FileDescriptor, Channel, SET, Object): SelectionKey Private method of the selector.
Close() Cancel all selection keys registered for the selector s and close the selector.
NextKey(): SelectionKey Return the next selection key of selector s with a non-empty intersection of SelectionKey.interestOps and Channel.readyOps.
RemoveSelectionKey(SelectionKey) Private method of the selector.
Select(LONGINT, LONGINT): LONGINT Determine if operations on registered channels are ready.
Inherited Methods
From Object.Object: Equals, HashCode, ToString From IO.Selector: AddSelectionKey, Close, NextKey, RemoveCanceled, RemoveSelectionKey, Select

Class Detail: SelectionKey

Class Detail: Selector

Constructor Detail

### Init

    PROCEDURE Init(s: Selector)

### Open

    PROCEDURE Open(): Selector

Method Detail

### AddSelectionKey

    PROCEDURE (s: Selector) AddSelectionKey(fd: FileDescriptor;
                              channel: Channel;
                              ops: SET;
                              attachment: Object): SelectionKey

> Private method of the selector. Create and initialize a selection key. The caller is responsible for adding the key to the selector.

> [Description inherited from AddSelectionKey]

> Redefines: AddSelectionKey

### Close

    PROCEDURE (s: Selector) Close()

> Cancel all selection keys registered for the selector s and close the selector.

> [Description inherited from Close]

> Redefines: Close

### NextKey

    PROCEDURE (s: Selector) NextKey(): SelectionKey

> Return the next selection key of selector s with a non-empty intersection of SelectionKey.interestOps and Channel.readyOps. Result is NIL if no such channel exists.

> [Description inherited from NextKey]

> Redefines: NextKey

### RemoveSelectionKey

    PROCEDURE (s: Selector) RemoveSelectionKey(k: SelectionKey)

> Private method of the selector. Do any bookkeeping require to eliminate the selection key. The caller is responsible for removing the key from the selector's list of keys.

> [Description inherited from RemoveSelectionKey]

> Redefines: RemoveSelectionKey

### Select

    PROCEDURE (s: Selector) Select(sec: LONGINT;
                     usec: LONGINT): LONGINT
      RAISES Error;

> Determine if operations on registered channels are ready. The function returns the number of channels with a non-empty ready set. Result is ``0`' if no channels are ready or have become ready until the time the specified timeout expires. If this function is called with a channel already being ready, then it behaves as if a timeout of zero had been requested.

> After a call to Selector.Select, the method Selector.NextKey iterates over all ready channels.

> [Description inherited from Select]

> Redefines: Select