21 int 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);
53 JControlHost starter(hostname);
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);
75 starter.GetFullData(buffer, length);
77 const string version(buffer, length);
80 DEBUG(
"Received version " << version << endl);
87 DEBUG(
"Send message " << message << endl);
89 starter.PutFullString(
RC_STRT, message);
92 starter.WaitHead(tag, length);
96 starter.GetFullData(buffer, length);
98 DEBUG(
"Got reply " <<
string(buffer,length) << endl);
102 ERROR(
"Timeout at connecting to " << hostname <<
" after " << timeout_s <<
" s." << endl);
105 catch(
const JControlHostException& error) {
106 ERROR(error << endl);