Rechercher une page de manuel
selector.3bobcat
Langue: en
Version: 320362 (ubuntu - 07/07/09)
Section: 3 (Bibliothèques de fonctions)
Sommaire
NAME
FBB::Selector - Timed delays, Alarms and Multiple File I/O.SYNOPSIS
#include <bobcat/selector>Linking option: -lbobcat
DESCRIPTION
FBB::Selector objects are wrappers around the select()(2) system calls and allow timed delays, alarm functionality and/or multiple file I/O. It requires the use of file descriptors, which are not an official part of C++. However, most operating systems offer file descriptors. Sockets are well-known file descriptors.NAMESPACE
FBBAll constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB.
INHERITS FROM
-CONSTRUCTORS
- o
- Selector():
This constructor initializes the object. The copy constructor is available.
MEMBER FUNCTIONS
- o
- void addExceptFd(int fd):
Adds a filedescriptor to the set of file descriptors that are monitored for exceptions (note these are not C++ exceptions. See man 2 select for details). - o
- void addReadFd(int fd):
Adds a filedescriptor to the set of file descriptors that are monitored for reading. - o
- void addWriteFd(int fd):
Adds a filedescriptor to the set of file descriptors that are monitored for writing. - o
- int exceptFd():
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
- void noAlarm():
This member prevents any timeout-alarm from occurring. - o
- int nReady():
Returns the number of available file descriptors. 0 is returned at a timeout, -1: is returned when select(2) itself failed. - o
- int readFd():
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. - o
- void rmExceptFd(int fd):
Removes a filedescriptor from the set of file descriptors that are monitored for exceptions (note these are not C++ exceptions. See man 2 select for details). - o
- void rmReadFd(int fd):
Removes a filedescriptor from the set of file descriptors that are monitored for reading. - o
- void rmWriteFd(int fd):
Removes a filedescriptor from the set of file descriptors that are monitored for writing. - o
- void setAlarm(int sec, int usec = 0):
This member sets the alarm at the indicated seconds and milli-seconds. If no action occurred on one of the monitored file descriptions, wait() will return with nREady() returning 0. - o
- int wait():
This member should be called to wait for activities on the installed file descriptors or timeout-period. The members nReady() and get...() show their defined behaviors only after wait() has returned. It throws an FBB::Errno exception when select() fails, which may very well indicate the end of any available input. - o
- int writeFd():
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.
EXAMPLE
To doFILES
bobcat/selector - defines the class interfaceSEE ALSO
bobcat(7), select(2)BUGS
None Reported.DISTRIBUTION FILES
- o
- bobcat_2.00.1-x.dsc: detached signature;
- o
- bobcat_2.00.1-x.tar.gz: source archive;
- o
- bobcat_2.00.1-x_i386.changes: change log;
- o
- libbobcat1_2.00.1-x_i386.deb: debian package holding the libraries;
- o
- libbobcat1-dev_2.00.1-x_i386.deb: debian package holding the libraries, headers and manual pages;
- o
- http://sourceforge.net/projects/bobcat: public archive location;
BOBCAT
Bobcat is an acronym of `Brokken's Own Base Classes And Templates'.COPYRIGHT
This is free software, distributed under the terms of the GNU General Public License (GPL).AUTHOR
Frank B. Brokken (f.b.brokken@rug.nl).Contenus ©2006-2024 Benjamin Poulain
Design ©2006-2024 Maxime Vantorre