Class to tie sockets to for monitoring by Csocket at either the Csock or TSockManager.
More...
#include <Csocket.h>
Class to tie sockets to for monitoring by Csocket at either the Csock or TSockManager.
◆ CSMonitorFD()
CSMonitorFD::CSMonitorFD |
( |
| ) |
|
|
inline |
◆ ~CSMonitorFD()
virtual CSMonitorFD::~CSMonitorFD |
( |
| ) |
|
|
inlinevirtual |
◆ Add()
void CSMonitorFD::Add |
( |
cs_sock_t |
iFD, |
|
|
short |
iMonitorEvents |
|
) |
| |
|
inline |
adds a file descriptor to be monitored
- Parameters
-
iFD | the file descriptor |
iMonitorEvents | bitset of events to monitor for ( |
- See also
- CSockManager::ECheckType)
◆ CheckFDs()
virtual bool CSMonitorFD::CheckFDs |
( |
const std::map< cs_sock_t, short > & |
miiReadyFds | ) |
|
|
virtual |
gets called to diff miiReadyFds with m_miiMonitorFDs, and calls FDsThatTriggered when appropriate.
Typically you don't need to reimplement this.
- Parameters
-
miiReadyFds | the map of all triggered fd's, not just the fd's from this class |
- Returns
- returning false will remove this from monitoring
◆ DisableMonitor()
void CSMonitorFD::DisableMonitor |
( |
| ) |
|
|
inline |
causes this monitor to be removed
◆ FDsThatTriggered()
virtual bool CSMonitorFD::FDsThatTriggered |
( |
const std::map< cs_sock_t, short > & |
miiReadyFds | ) |
|
|
inlinevirtual |
called when there are fd's belonging to this class that have triggered
- Parameters
-
miiReadyFds | the map of fd's with the bits that triggered them ( |
- See also
- CSockManager::ECheckType)
- Returns
- returning false will remove this from monitoring
◆ GatherFDsForSelect()
virtual bool CSMonitorFD::GatherFDsForSelect |
( |
std::map< cs_sock_t, short > & |
miiReadyFds, |
|
|
long & |
iTimeoutMS |
|
) |
| |
|
virtual |
called before select, typically you don't need to reimplement this just add sockets via Add and let the default implementation have its way
- Parameters
-
miiReadyFds | fill with fd's to monitor and the associated bit to check them for ( |
- See also
- CSockManager::ECheckType)
- Parameters
-
iTimeoutMS | the timeout to change to, setting this to -1 (the default) |
- Returns
- returning false will remove this from monitoring. The same effect can be had by setting m_bEnabled to false as it is returned from this
◆ IsEnabled()
bool CSMonitorFD::IsEnabled |
( |
| ) |
const |
|
inline |
◆ Remove()
removes this fd from monitoring
◆ m_bEnabled
bool CSMonitorFD::m_bEnabled |
|
protected |
◆ m_miiMonitorFDs
std::map< cs_sock_t, short > CSMonitorFD::m_miiMonitorFDs |
|
protected |
The documentation for this class was generated from the following file: