Belle II Software development
HistoServer2.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <string>
11
12#include <daq/dataflow/EvtSocket.h>
13#include <daq/dataflow/EvtSocketManager.h>
14
15#include <daq/dqm/HistoManager2.h>
16#include <map>
17#include <vector>
18
19namespace Belle2 {
26 public:
27 enum {c_maxBufSize = 160000000 };
29 enum { c_mergeIntervall = 5000 };
30
31 public:
32 HistoServer2(int port, const std::string& mapfile);
34
35 int init();
36
37 int server(); // Loop
38
39 private:
40 EvtSocketRecv* m_sock;
41 EvtSocketManager* m_man;
42 int m_port;
43 int m_force_exit;
44
46 void write_state(void);
47 private:
48 std::string m_filename;
49 HistoManager2* m_hman;
50
52 std::map <std::string, std::pair<int, bool>> m_units_connected;
53 std::map <std::string, time_t> m_unit_last_conn_time;
54 std::map <std::string, time_t> m_unit_last_packet_time;
55 std::map <std::string, time_t> m_unit_last_content_time;
56 time_t m_last_merge_time{};
57 };
59}
60
std::map< std::string, std::pair< int, bool > > m_units_connected
connection IP, state and last update time
Definition: HistoServer2.h:52
void write_state(void)
Write connection state to a file.
Abstract base class for different kinds of events.