21int main(
int argc,
const char *argv[])
33 JParser<> zap(
"Auxiliary program to start (remote) run control client.");
42 catch(
const exception &error) {
43 FATAL(error.what() << endl);
49 JControlHost::Throw(
true);
56 long long int length = 0;
58 bool is_alive =
false;
60 for (
int i = 0; i != timeout_s; ++i) {
62 is_alive = (starter.
CheckHead(tag, length) > 0);
77 const string version(buffer, length);
79 DEBUG(
"Current version " << CHOO_VERSION << endl);
80 DEBUG(
"Received version " << version << endl);
82 if (version != CHOO_VERSION) {
83 WARNING(
"Version mis-match: " << version <<
" " << CHOO_VERSION << endl);
87 DEBUG(
"Send message " << message << endl);
98 DEBUG(
"Got reply " <<
string(buffer,length) << endl);
102 ERROR(
"Timeout at connecting to " << hostname <<
" after " << timeout_s <<
" s." << endl);
106 ERROR(error << endl);
int main(int argc, const char *argv[])
General purpose messaging.
#define DEBUG(A)
Message macros.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Exception for ControlHost.
int PutFullString(const JTag &tag, const std::string &buffer)
Send string.
int WaitHead(JPrefix &prefix)
Wait for header.
int CheckHead(JPrefix &prefix, JTimeval timeout=JTimeval::min())
Check for header, without waiting.
int GetFullData(void *buffer, long long int length)
Receive data.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
KM3NeT DAQ data structures and auxiliaries.
Auxiliary data structure for hostname and port number.