Files
pcas/src/cas/generic/st/caServerOS.cc
T
Jeff Hill 33d29a458d o changed UDP to non-blocking IO
o cleaned up (consolodated) UDP interface class structure
1999-09-02 21:50:29 +00:00

83 lines
1.0 KiB
C++

/*
*
* caServerOS.c
* $Id$
*
*/
//
// CA server
//
#include "server.h"
//
// casBeaconTimer
//
class casBeaconTimer : public osiTimer {
public:
casBeaconTimer (double delay, caServerOS &osIn) :
osiTimer(delay), os (osIn) {}
void expire();
double delay() const;
bool again() const;
const char *name() const;
private:
caServerOS &os;
};
//
// caServerOS::caServerOS()
//
caServerOS::caServerOS ()
{
this->pBTmr = new casBeaconTimer(0.0, *this);
if (!this->pBTmr) {
throw S_cas_noMemory;
}
}
//
// caServerOS::~caServerOS()
//
caServerOS::~caServerOS()
{
if (this->pBTmr) {
delete this->pBTmr;
}
}
//
// casBeaconTimer::expire()
//
void casBeaconTimer::expire()
{
os.sendBeacon ();
}
//
// casBeaconTimer::again()
//
bool casBeaconTimer::again() const
{
return true;
}
//
// casBeaconTimer::delay()
//
double casBeaconTimer::delay() const
{
return os.getBeaconPeriod();
}
//
// casBeaconTimer::name()
//
const char *casBeaconTimer::name() const
{
return "casBeaconTimer";
}