50{
51 NSMCommunicatorList& com_v(NSMCommunicator::get());
52 try {
53 {
54 std::string nodename = com_v[0]->getCallback().getNode().getName();
55 std::string filename = ("/tmp/nsmvget." + StringUtil::tolower(nodename));
56 std::ifstream fin(filename.c_str());
57 std::vector<std::string> nodes, vnames;
58 std::string node, vname;
59 while (fin >> node >> vname) {
60 nodes.push_back(node);
61 vnames.push_back(vname);
62 }
63 ::remove(filename.c_str());
64 for (size_t i = 0; i < com_v.size(); i++) {
66 for (size_t j = 0; j < nodes.size(); j++) {
67 com.getCallback().vget(nodes[j], vnames[j]);
68 }
69 }
70 }
71 double t0 =
Time().get();
72 while (true) {
73 try {
75 com.getCallback().perform(com);
77 for (size_t i = 0; i < com_v.size(); i++) {
79 while (com.hasQueue()) {
80 com.setMessage(com.popQueue());
81 com.getCallback().perform(com);
82 }
83 }
84 double t =
Time().get();
85 if (t - t0 >= m_timeout) {
86 for (size_t i = 0; i < com_v.size(); i++) {
88 com.getCallback().timeout(com);
89 com.getCallback().alloc_open(com);
90 }
91 t0 = t;
92 }
93 }
94 } catch (const std::exception& e) {
95 LogFile::fatal("NSM node brdge : Caught exception %s\n"
96 "Terminate process...", e.what());
97 }
98 for (size_t i = 0; i < com_v.size(); i++) {
100 com.getCallback().term();
101 }
102}