Skip to content

Commit

Permalink
Update monica-capnp-fbp-component-main.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
bergm committed Jun 14, 2024
1 parent 2547933 commit a3f10e4
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/run/monica-capnp-fbp-component-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ class FBPMain {
}
try {
while (true) {
KJ_LOG(INFO, "trying to read from IN port");
auto msg = inp.readRequest().send().wait(ioContext.waitScope);
KJ_LOG(INFO, "received msg");
KJ_LOG(INFO, "received msg from IN port");
// check for end of data from in port
if (msg.isDone()) {
KJ_LOG(INFO, "received done -> exiting main loop");
Expand All @@ -123,21 +124,18 @@ class FBPMain {
auto toAttrBuilder = mas::infrastructure::common::copyAndSetIPAttrs(inIp, outIp,
toAttr);//, capnp::toAny(resJsonStr));
KJ_IF_MAYBE(builder, toAttrBuilder) builder->setAs<capnp::Text>(resJsonStr);
KJ_LOG(INFO, "sending result on out port");
KJ_LOG(INFO, "trying to send result on OUT port");
wreq.send().wait(ioContext.waitScope);
KJ_LOG(INFO, "sent result on out port");
KJ_LOG(INFO, "sent result on OUT port");
}
}

}
KJ_LOG(INFO, "closing out port");
KJ_LOG(INFO, "closing OUT port");
outp.closeRequest().send().wait(ioContext.waitScope);
//cout << "monica-capnp-fbp-component-main: closed result out port" << endl;
}
catch (const kj::Exception &e) {
KJ_LOG(INFO, "Exception: ", e.getDescription());
std::cerr << "Exception: " << e.getDescription().cStr() << endl;
//std::cout << "Exception: " << e.getDescription().cStr() << endl;
}

return true;
Expand Down

0 comments on commit a3f10e4

Please sign in to comment.