NAME

src/dynpmc/select.pmc - Select PMC

DESCRIPTION

This is the base-class for non-blocking IO using select().

Functions

INTVAL find_max_fd(INTERP, PMC *fd_map)
Returns the maximum of all the c89 standard integer file descriptors held by the Hash PMC

Vtable Functions

void init()
Initializes the PMC.
void mark()
Mark fd_map hash as live.

Methods

METHOD INTVAL max_fd()
Returns the maximum of all the c89 standard integer file descriptors held by the Select PMC
METHOD PMC* fd_map()
Returns the Hash PMC that holds the mapping from file descriptor to the opaque PMC associated with the file descriptor when it was added to the Select PMC.Used mainly for testing purposes.
METHOD update(PMC* filehandle, PMC* data, INTVAL read_write_error_flag)
Adds filehandle PMC to the Select PMC for monitoring based on the read_write_error_flagsread_write_error_flag = READ (0x1) | WRITE (0x2) | ERROR (0x4)An array of data PMCs are returned by the can_read, can_read, has_exception, and select methods when the filehandles meet one of read_write_error_flag conditions.
METHOD remove(PMC* filehandle)
Removes filehandle from the Select PMC.
METHOD can_read()
Returns the associated data for the file descriptors in the Select PMC, which are ready to be read from.Waits for a maximum of timeout seconds for a file descriptor to be ready to read before returning.
METHOD can_write()
Returns the associated data for the file descriptors in the Select PMC, which are ready to be written to.Waits for a maximum of timeout seconds for a file descriptor to be ready to write to before returning.
METHOD has_exception()
Returns the associated data for the file descriptors in the Select PMC, which are in an exception state.Waits for a maximum of timeout seconds for a file descriptor to be in an exception state before returning.
METHOD select()
Returns the associated data for the file descriptors in the Select PMC, which are ready to be read, written, or have an exception to be handled.Waits for a maximum of timeout seconds for a file descriptor to be ready to be handled.