#include #include #include #include #include "JNet/JControlHost.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Example program to test JNET::JControlHost::WhereIs. * \author mdejong */ int main(int argc, char* argv[]) { using namespace std; using namespace JPP; string hostname; string nickname; int debug; try { JParser<> zap("Example program to test where is functionality of ControlHost server."); zap['H'] = make_field(hostname) = "localhost"; zap['M'] = make_field(nickname); zap['d'] = make_field(debug) = 1; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } string answer; JControlHost::WhereIs(hostname, nickname, answer); istringstream is(answer); for (string buffer; is >> buffer; ) { NOTICE("Host: " << buffer << endl); } }