1 #ifndef _ots_ReceiverSocket_h_
2 #define _ots_ReceiverSocket_h_
4 #include "otsdaq/NetworkUtilities/Socket.h"
25 while(recvfrom(socketNumber_,
37 int receive(std::string& buffer,
38 unsigned int timeoutSeconds = 1,
39 unsigned int timeoutUSeconds = 0,
40 bool verbose =
false);
41 int receive(std::vector<uint32_t>& buffer,
42 unsigned int timeoutSeconds = 1,
43 unsigned int timeoutUSeconds = 0,
44 bool verbose =
false);
45 int receive(std::string& buffer,
46 unsigned long& fromIPAddress,
47 unsigned short& fromPort,
48 unsigned int timeoutSeconds = 1,
49 unsigned int timeoutUSeconds = 0,
50 bool verbose =
false);
51 int receive(std::vector<uint32_t>& buffer,
52 unsigned long& fromIPAddress,
53 unsigned short& fromPort,
54 unsigned int timeoutSeconds = 1,
55 unsigned int timeoutUSeconds = 0,
56 bool verbose =
false);
58 std::string getLastIncomingIPAddress(
void);
59 unsigned short getLastIncomingPort(
void);
65 fd_set fileDescriptor_;
66 struct timeval timeout_;
67 struct sockaddr_in fromAddress_;
68 socklen_t addressLength_;
71 unsigned long lastIncomingIPAddress_ = 0;
72 unsigned short lastIncomingPort_ = 0;
73 unsigned int readCounter_;
75 std::mutex receiveMutex_;
int receive(std::string &buffer, unsigned int timeoutSeconds=1, unsigned int timeoutUSeconds=0, bool verbose=false)
returns count of dropped packets
ReceiverSocket(void)
protected constructor
defines used also by OtsConfigurationWizardSupervisor