aare/examples/zmq_multi_receiver.cpp
Bechir Braham 9637d0602f
receive multimodule (#65)
* add config files for multimodule receiving

* read subfiles with unordered and missing frames

* save work debugging

* Revert "save work debugging"

This reverts commit e791992a05efd754f93a80c980d17397eb4b6045.

* Revert "read subfiles with unordered and missing frames"

This reverts commit 1177fd129d3690db92e9597ccda62598e5a44d41.

* throw when two frames have different frame numbers

* write single part RawFile (working beta)

* correct total number of frames in master file

* add new mythen file with syncd frames

* save work

* save work for receive multimodule
multimodule config results in too much packet loss. needs more debugging.

* setup Task Distributiosn/ parallelization programming model

* read frames with same frame number

* clang-tidy fixes, formatting, add tests

* added second receiver

* Synchronize between zmq streams and merge frames

* improve readability in loop

* fix failing tests

* add simple test for merge frames

---------

Co-authored-by: Bechir <bechir.brahem420@gmail.com>
Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
2024-05-07 11:06:37 +02:00

29 lines
784 B
C++

#include "aare/examples/defs.hpp"
#include "aare/network_io/ZmqMultiReceiver.hpp"
#include "aare/network_io/ZmqSocketReceiver.hpp"
#include "aare/network_io/defs.hpp"
#include <boost/program_options.hpp>
#include <cassert>
#include <fmt/core.h>
#include <string>
using namespace aare;
namespace po = boost::program_options;
using namespace std;
int main() {
logger::set_verbosity(logger::DEBUG);
std::string const endpoint1 = "tcp://127.0.0.1:" + std::to_string(5555);
std::string const endpoint2 = "tcp://127.0.0.1:" + std::to_string(5556);
ZmqMultiReceiver socket({endpoint1, endpoint2}, {1, 2});
socket.connect();
while (true) {
auto frames = socket.receive_n();
logger::info("Received", frames.size(), "frames");
}
return 0;
}