Title:

setReader - establish an action to be evaluated each time input is available on a connection. This differs from the original implementation in that it uses a dedicated thread for each Reader and so more control over the allocation of resources for this reader is possible. Also, it is less likely that another task will starve this thread of resources.

Usage:

setReader(connection, action, name="", parent=NULL, start=T, group=NULL, priority=1, detach=F, access=T, onExit = NULL, input=NULL, output=NULL, error=NULL, attributes= threadAttributes(), toplevel=NULL, data=NULL, )
Note that many of the arguments are document from the thread() documentation since this class (ReaderThread) inherits from class thread.

Arguments:

connection:
the connection on which to listen for input. This is handled in the normal fashion regarding automatic opening and closing the stream/file descriptor.
action:
the function that takes the connection as an argument to be called each time input is found on the connection.

Side Effect:

a new thread is created that idly waits until input is found on a file descriptor and then evaluates a function for this connection. The thread is added to the control of the evaluator manager and if a threadGroup object is supplied via the group argument, the newly created thread is appended to the list of its elements.

See Also:

thread
thread()

Examples:


Key Words:


Last modified: Mon Feb 10 16:35:22 1997