File indexing completed on 2023-03-17 11:20:01
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 #ifndef HLXTCP_H
0026 #define HLXTCP_H
0027
0028 #include <string>
0029 #include <netinet/in.h> // struct sockaddr_in
0030
0031 namespace HCAL_HLX {
0032
0033 struct LUMI_SECTION;
0034
0035 class TCPReceiver {
0036 public:
0037 TCPReceiver();
0038 TCPReceiver(unsigned short int, std::string, unsigned char);
0039 ~TCPReceiver();
0040 int Connect();
0041 int SetPort(unsigned short int);
0042 int SetMode(unsigned char);
0043 void SetIP(std::string IP);
0044 int ReceiveLumiSection(HCAL_HLX::LUMI_SECTION& localSection);
0045 int Disconnect();
0046 bool IsConnected();
0047 bool VerifyFakeData(HCAL_HLX::LUMI_SECTION& localSection);
0048
0049 void GenerateFakeData(HCAL_HLX::LUMI_SECTION& localSection);
0050 void GenerateRandomData(HCAL_HLX::LUMI_SECTION& localSection);
0051
0052 private:
0053 unsigned char acquireMode;
0054 bool Connected;
0055
0056 unsigned short servPort;
0057 std::string servIP;
0058 int tcpSocket;
0059 struct sockaddr_in servAddr;
0060 };
0061 }
0062
0063 #endif