23int main(
int argc,
const char *argv[])
38 JParser<> zap(
"Auxiliary program to send messages to ControlHost server.");
41 zap[
't'] =
make_field(tag) = DISPTAG_UNDEFINED;
42 zap[
'T'] =
make_field(Tag) = DISPTAG_UNDEFINED;
44 zap[
'n'] =
make_field(numberOfEvents) = numeric_limits<int>::max();
50 catch(
const exception &error) {
51 FATAL(error.what() << endl);
55 if (tag == DISPTAG_UNDEFINED && Tag == DISPTAG_UNDEFINED) {
56 FATAL(
"No tags specified.");
59 JControlHost::Throw(
true);
65 JTimekeeper timer((
long long int) (1.0e6 / rate_Hz));
69 for (
int i = 0; i != size; ++i) {
70 buffer[i] =
'a' + (i%26);
78 const long long int t0 = getLocalTime();
80 for (
int i = 1; i <= numberOfEvents; ++i) {
82 if (Tag != DISPTAG_UNDEFINED) { out.
PutFullData(Tag, buffer.data(), buffer.size()); ++all; }
83 if (tag != DISPTAG_UNDEFINED) { out.
PutFullData(tag, buffer.data(), buffer.size()); ++few; }
87 const long long int t1 = getLocalTime();
89 DEBUG(
"Time [us] " << setw(10) << t1 - t0 << endl);
90 DEBUG(
"<delay> [us] " << setw(10) << timer.
getDelay() / i << endl);
91 DEBUG(
"Count all " << setw(10) << all << endl);
92 DEBUG(
"Count few " << setw(10) << few << endl);