MprSelectService Class Reference

List of all members.

Detailed Description

Manage system select() call and the set of I/O handles.


Public Member Functions

int  getFds (fd_set *readInterest, fd_set *writeInterest, fd_set *exceptInterest, int *maxFd, int *lastGet)
void  serviceIO (int sockFd, int winMask)
void  serviceIO (int readyFds, fd_set *readFds, fd_set *writeFds, fd_set *exceptFds)

Member Function Documentation

int MprSelectService::getFds fd_set *  readInterest,
fd_set *  writeInterest,
fd_set *  exceptInterest,
int *  maxFd,
int *  lastGet
 

Synopsis:
Get the select file masks for all MPR file and sockets.
Overview:
The getFds call set the select I/O masks for all files and sockets in use by the MPR. Application event loops should call getFds and then OR in their own file descriptors before calling select using the masks. getFds will only modify the masks if the I/O interests of underlying file descriptors have changed. This means that getFds may not modify the masks if nothing much has changed. It is imperative that you not clear the masks between calls to getFds. Consequently, you should copy or save the masks before using them in select -- as select will modify the masks. If you want to force getFds to rebuild the masks, zero the value pointed to by the lastGet parameter.
Parameters:
readInterest  fd_set read interest mask
writeInterest  fd_set write interest mask
exceptInterest  Not used
maxFd  Number of the highest file descriptor plus 1. This value is used by select.
lastGet  Pointer to a timestamp integer used by getFds to manage when getFds was last run. The value pointed to should be initialized to -1.
Returns:
Returns TRUE if the masks were modified.
Stability classification:
Evolving.
Library:
libappWeb
See also:
Mpr, getIdleTime, runTasks, runTimers

void MprSelectService::serviceIO int  sockFd,
int  winMask
 

Synopsis:
Service any pending I/O events for a given socket (Windows)
Overview:
serviceIO service the I/O event specified in winMask for the given socket.
Parameters:
sockFd  Socket descriptor
winMask  Windows Message I/O mask
Stability classification:
Evolving.
Library:
libappWeb
See also:
Mpr, getIdleTime, runTasks, runTimers, getFds

void MprSelectService::serviceIO int  readyFds,
fd_set *  readFds,
fd_set *  writeFds,
fd_set *  exceptFds
 

Synopsis:
Service any pending I/O events
Overview:
serviceIO will analyse the provided select masks and will call all registered select handlers if an I/O event has occurred for that handler. MprSocket automatically creates select handlers on Unix and so the socket handlers will be also invoked if an I/O event occurs. This routine call be called on Windows, but the native windows message mechanism will provide higher throughput.
Parameters:
readyFds  Number of file descriptors with I/O events
readFds  Read select mask
writeFds  Write select mask
exceptFds  Exception select mask
Stability classification:
Evolving.
Library:
libappWeb
See also:
Mpr, getIdleTime, runTasks, runTimers, getFds

The documentation for this class was generated from the following files:

© Mbedthis Software LLC, 2003-2004. All rights reserved. Mbedthis is a trademark of Mbedthis Software LLC.