otsdaq  3.04.02
TransceiverSocket.h
1 #ifndef _ots_TransceiverSocket_h_
2 #define _ots_TransceiverSocket_h_
3 
4 #include "otsdaq/NetworkUtilities/ReceiverSocket.h"
5 #include "otsdaq/NetworkUtilities/TransmitterSocket.h"
6 
7 #include <string>
8 
9 namespace ots
10 {
12 {
13  public:
14  TransceiverSocket(std::string IPAddress, unsigned int port = 0);
15  virtual ~TransceiverSocket(void);
16 
17  int acknowledge(const std::string& buffer,
18  bool verbose = false);
19 
20  std::string sendAndReceive(Socket& toSocket,
21  const std::string& sendBuffer,
22  unsigned int timeoutSeconds = 1,
23  unsigned int timeoutUSeconds = 0,
24  bool verbose = false);
25 
26  protected:
27  TransceiverSocket(void);
28 
29  private:
30  std::mutex sendAndReceiveMutex_;
31 };
32 
33 } // namespace ots
34 
35 #endif
std::string sendAndReceive(Socket &toSocket, const std::string &sendBuffer, unsigned int timeoutSeconds=1, unsigned int timeoutUSeconds=0, bool verbose=false)
int acknowledge(const std::string &buffer, bool verbose=false)
responds to last receive location
defines used also by OtsConfigurationWizardSupervisor