-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lassi Tuura
committed
Oct 5, 2009
1 parent
c54e4dd
commit 0951081
Showing
2 changed files
with
20 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,28 @@ | ||
#include "DQMServices/Core/interface/DQMOldReceiver.h" | ||
#include "DQMServices/Core/interface/DQMStore.h" | ||
#include "DQMServices/Core/interface/DQMNet.h" | ||
#include <iostream> | ||
#include "DQMServices/Core/src/DQMError.h" | ||
|
||
// Connect with monitoring server (DQM Collector) at <hostname> and <port_no> | ||
// using <client_name>; if flag=true, will accept downstream connections | ||
DQMOldReceiver::DQMOldReceiver(const std::string &hostname, int port, | ||
const std::string &clientName, | ||
int unusedReconnectDelaySecs, | ||
bool unusedActAsServer) | ||
: store_ (DQMStore::instance()), | ||
net_ (new DQMBasicNet (clientName)), | ||
numUpdates_ (0) | ||
{ | ||
net_->requestFullUpdates(true); | ||
} | ||
DQMOldReceiver::DQMOldReceiver(const std::string &, int, const std::string &, int, bool) | ||
: store_ (DQMStore::instance()) | ||
{} | ||
|
||
/* Use the default constructor for running in standalone mode (ie. without | ||
sources or collectors); if flag=true, client will accept downstream connections | ||
*/ | ||
DQMOldReceiver::DQMOldReceiver(void) | ||
: store_ (DQMStore::instance()), | ||
net_ (0), | ||
numUpdates_ (0) | ||
: store_ (DQMStore::instance()) | ||
{} | ||
|
||
DQMOldReceiver::~DQMOldReceiver(void) | ||
{ | ||
delete net_; | ||
} | ||
{} | ||
|
||
// this is the "main" loop where we receive monitoring/send subscription requests; | ||
// if client acts as server, method runQTests is also sending monitoring & | ||
// test results to clients downstream; | ||
// returns success flag | ||
bool | ||
DQMOldReceiver::update(void) | ||
{ | ||
std::cout | ||
<< " In DQMOldReceiver::update:\n" | ||
<< " This method will be deprecated soon, please replace mui->update() by:\n" | ||
<< " bool ret = mui->doMonitoring();\n" | ||
<< " bei->runQTests();\n"; | ||
|
||
// retrieval of monitoring, sending of subscription requests/cancellations, | ||
// calculation of "collate"-type Monitoring Elements; | ||
bool ret = doMonitoring(); | ||
|
||
// Run quality tests (and determine updated contents); | ||
// Method is overloaded if client acts as server to other clients downstream | ||
store_->runQTests(); | ||
|
||
return ret; | ||
raiseDQMError("DQMOldReceiver", "DQMOldReceiver::update() is obsolete"); | ||
return true; | ||
} | ||
|
||
// retrieval of monitoring, sending of subscription requests/cancellations, | ||
// returns success flag | ||
bool | ||
DQMOldReceiver::doMonitoring(void) | ||
{ | ||
store_->reset(); | ||
numUpdates_ += (net_ ? net_->receive(store_) : 0); | ||
// FIXME: Invoke callbacks? | ||
raiseDQMError("DQMOldReceiver", "DQMOldReceiver::doMonitoring() is obsolete"); | ||
return true; | ||
} |