27int main(
int argc,
const char *argv[])
40 JParser<> zap(
"Auxiliary program to receive messages from ControlHost server.");
42 zap[
'H'] =
make_field(hostname,
"host name of message srver") =
"localhost";
45 zap[
'D'] =
make_field(date,
"print date and time of message receipt");
50 catch(
const exception &error) {
51 FATAL(error.what() << endl);
55 if (tagList.empty() && TagList.empty()) {
56 FATAL(
"No tags specified.");
60 JControlHost::Throw(
true);
77 in.
MyId(
"JGetMessage");
86 for (
const string stop(
"stop"); buffer.size() != stop.size() ||
string(buffer.data(), stop.size()) != stop; ) {
90 buffer.resize(prefix.
getSize());
95 cout << getDateAndTime() <<
' ';
98 cout << left << setw(8) << prefix.
getTag() <<
' ' << right << setw(8) << prefix.
getSize();
100 if (TagList.find(prefix) != TagList.end()) {
101 cout <<
' ' << string(buffer.data(), buffer.size());
107 catch(
const exception& error) {
108 FATAL(error.what() << endl);
int main(int argc, const char *argv[])
General purpose messaging.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
int MyId(const std::string &nick_name)
Identify.
int WaitHead(JPrefix &prefix)
Wait for header.
int GetFullData(void *buffer, long long int length)
Receive data.
int SendMeAlways()
Tell server to send messages forever.
int Subscribe(const JSubscription &subscription)
Subscribe to single tag.
int getSize() const
Get size.
JSubscriptionList & add(const JSubscription &subscription)
Add subscription.
const JTag & getTag() const
Get tag.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary class for all subscription.
Auxiliary class for any subscription.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...