4 #ifndef EventFilter_StorageManager_EventServerProxy_h
5 #define EventFilter_StorageManager_EventServerProxy_h
35 template<
typename RegInfo>
109 CURLcode
result = curl->postBinaryMessage(
110 regInfo_.sourceURL() +
"/getregdata",
112 requestMessage.
size(),
116 if ( result != CURLE_OK )
119 edm::LogError(
"EventServerProxy") <<
"curl perform failed for header:"
120 << std::string(&data[0]) << std::endl
121 <<
". Trying to reconnect.";
123 registerWithEventServer();
128 if(!alreadySaidWaiting_) {
129 edm::LogInfo(
"EventServerProxy") <<
"...waiting for header from event server...";
130 alreadySaidWaiting_ =
true;
133 ::sleep(regInfo_.headerRetryInterval());
137 alreadySaidWaiting_ =
false;
153 const unsigned int MAX_DUMP_LENGTH = 1000;
154 std::ostringstream
dump;
155 dump <<
"========================================" << std::endl;
156 dump <<
"* Exception decoding the getregdata response from the event server!" << std::endl;
157 if (data.size() <= MAX_DUMP_LENGTH)
159 dump <<
"* Here is the raw text that was returned:" << std::endl;
160 dump << std::string(&data[0]) << std::endl;
164 dump <<
"* Here are the first " << MAX_DUMP_LENGTH <<
165 " characters of the raw text that was returned:" << std::endl;
166 dump << std::string(&data[0], MAX_DUMP_LENGTH) << std::endl;
168 dump <<
"========================================" << std::endl;
182 getInitMsgFromEventServer(data);
188 <<
"The header read was aborted by a shutdown request.\n";
196 #endif // EventFilter_StorageManager_EventServerProxy_h
bool extractConsumerId(CurlInterface::Content &)
void connectToEventServer(CurlInterface::Content &)
void getInitMsgFromEventServer(CurlInterface::Content &)
bool getEventMaybe(CurlInterface::Content &data)
void checkInitMsg(CurlInterface::Content &)
boost::posix_time::time_duration Duration_t
static boost::shared_ptr< CurlInterface > getInterface()
virtual ~EventServerProxy()
const stor::utils::Duration_t minEventRequestInterval_
boost::posix_time::ptime TimePoint_t
void registerWithEventServer()
void getInitMsg(CurlInterface::Content &data)
boost::shared_ptr< CurlInterface > CurlInterfacePtr
void getOneEventFromEventServer(CurlInterface::Content &)
stor::utils::TimePoint_t nextRequestTime_
void checkEvent(CurlInterface::Content &)
char data[epos_bytes_allocation]
void getOneEvent(CurlInterface::Content &data)
EventServerProxy(edm::ParameterSet const &)
volatile bool shutdown_flag
unsigned int failedAttemptsToGetData_
std::vector< char > Content