IO:Select

Import List

    IO
    Object
    Object
    RT0
 
Class List
SelectionKey
Selector
Class Summary: SelectionKey [Detail]
  +---RT0.Object
       |
       +---Object.Object
            |
            +---IO.SelectionKey
                 |
                 +--IO:Select.SelectionKey
Inherited Fields

From IO.SelectionKey:

          attachment, channel, fd, interestOps, nextKey, selector

Inherited Methods

From RT0.Object:

          Finalize

From Object.Object:

          Equals, HashCode, ToString

From IO.SelectionKey:

          Attach, Cancel, INIT, SetInterestOps

 
Class Summary: Selector [Detail]
  +---RT0.Object
       |
       +---Object.Object
            |
            +---IO.Selector
                 |
                 +--IO:Select.Selector
Inherited Fields

From IO.Selector:

          keys

Constructor Summary
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.
INIT()

          
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 RT0.Object:

          Finalize

From Object.Object:

          Equals, HashCode, ToString

From IO.Selector:

          AddSelectionKey, Close, INIT, NextKey, RemoveCanceled, RemoveSelectionKey, Select

 

Class Detail: SelectionKey
 
Class Detail: Selector
Constructor Detail

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


INIT

PROCEDURE (s: Selector) INIT()

Redefines: INIT


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