Line data Source code
1 : /**
2 : * @file iomanager_wrapper.cpp IOManagerWrapper class definition : wrapper of the IOManager to adapt it to the
3 : * snbmodules
4 : *
5 : * This is part of the DUNE DAQ , copyright 2020.
6 : * Licensing/copyright details are in the COPYING file that you should have
7 : * received with this code.
8 : */
9 :
10 : #include "snbmodules/iomanager_wrapper.hpp"
11 :
12 : #include <string>
13 : #include <utility>
14 :
15 : namespace dunedaq::snbmodules {
16 :
17 : #if 0
18 : void IOManagerWrapper::init_connection_interface(const std::string &session_name, bool use_connectivity_service, const IPFormat &ip)
19 : {
20 : dunedaq::logging::Logging::setup();
21 :
22 : setenv("DUNEDAQ_SESSION", session_name.c_str(), 0);
23 :
24 : if (use_connectivity_service)
25 : {
26 : setenv("CONNECTION_SERVER", ip.get_ip().c_str(), 1);
27 : setenv("CONNECTION_PORT", std::to_string(ip.get_port()).c_str(), 1);
28 : }
29 :
30 : iomanager::IOManager::get()->configure(m_queues, m_connections, use_connectivity_service, std::chrono::milliseconds(100));
31 : }
32 :
33 : void IOManagerWrapper::add_connection(const IPFormat &ip, std::string id, std::string data_type)
34 : {
35 : iomanager::Connection conn = iomanager::Connection{iomanager::ConnectionId{std::move(id), std::move(data_type)},
36 : "tcp://" + ip.get_ip() + ":" + (std::to_string(ip.get_port()) == "0" ? "*" : std::to_string(ip.get_port())),
37 : iomanager::ConnectionType::kSendRecv};
38 :
39 : TLOG() << "debug : Added connection " << conn.id.uid << " uri: " << conn.uri;
40 : m_connections.emplace_back(std::move(conn));
41 : }
42 : #endif
43 :
44 : iomanager::ConnectionResponse
45 0 : IOManagerWrapper::lookups_connection(iomanager::ConnectionId const& conn_id, bool restrict_single)
46 : {
47 0 : TLOG() << "BLAB " << __LINE__ << " " << conn_id.uid << " " << conn_id.data_type << " " << conn_id.session;
48 0 : return iomanager::NetworkManager::get().get_connections(conn_id, restrict_single);
49 : }
50 : } // namespace dunedaq::snbmodules
|