o voidaddExceptFd(intfd):
Adds a filedescriptor to the set of file descriptors that are monitored for exceptions (note these
are not C++ exceptions. See man2select for details).
o voidaddReadFd(intfd):
Adds a filedescriptor to the set of file descriptors that are monitored for reading.
o voidaddWriteFd(intfd):
Adds a filedescriptor to the set of file descriptors that are monitored for writing.
o intexceptFd():
Returns -1 of no more file descriptors are available in the exception category. Otherwise the next
available file descriptor in the exception category is returned. Returning from wait, this
function can be called repeatedly until -1 is returned, servicing each available filedescriptor in
turn.
o voidnoAlarm():
This member prevents any timeout-alarm from occurring.
o intnReady():
Returns the number of available file descriptors. 0 is returned at a timeout, -1: is returned
when select(2) itself failed.
o intreadFd():
Returns -1 of no more file descriptors are available for reading. Otherwise the next available
file descriptor for reading is returned. Returning from wait, this function can be called
repeatedly until -1 is returned, servicing each available filedescriptor in turn. Note that the
file whose file descriptor is returned by readFd may also be at its end-of-file position. The file
is `ready for reading’, but no characters will be returned when trying to read from it due to its
end-of-file status. In that case the file descriptor is probably best removed from the set of
active file descriptors.
o voidrmExceptFd(intfd):
Removes a filedescriptor from the set of file descriptors that are monitored for exceptions (note
these are not C++ exceptions. See man2select for details).
o voidrmReadFd(intfd):
Removes a filedescriptor from the set of file descriptors that are monitored for reading.
o voidrmWriteFd(intfd):
Removes a filedescriptor from the set of file descriptors that are monitored for writing.
o voidsetAlarm(intsec,intusec=0):
This member sets the alarm at the indicated seconds and micro-seconds. If no action occurred on
one of the monitored file descriptions following the indicated amount of time, wait will return
with nReady returning 0. The requested alarm time (sec+usec/1e+6) may not be negative and may
not exceed std::numeric_limits<int>::max() or an FBB::Exception exception will be thrown. A 0
alarm time specification results in wait returning immediately. To switch off the alarm time use
noAlarm.
o intwait():
This member should be called to wait for activities on the installed file descriptors or
timeout-period. The members exceptFd,nReady,readFd and writeFd show their defined behaviors only
after wait has returned.
It throws an FBB::Exception exception when select(2) fails, which may very well indicate the end
of any available input. An exception is also thrown if the program received a signal.
If wait returns normally its return value represents the number of available file descriptors.
Note that wait may also return with an input file descriptor returned by readFd of a file at its
end-of-file position. The file is `ready for reading’, but no characters will be returned when
trying to read from it due to its end-of-file status.
o intwriteFd():
Returns -1 of no more file descriptors are available for writing. Otherwise the next available
file descriptor for writing is returned. Returning from wait, this function can be called
repeatedly until -1 is returned, servicing each available filedescriptor in turn.