otsdaq  3.07.00
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 
18  int acknowledge(const std::string& buffer,
19  bool verbose = false,
20  size_t maxChunkSize = 1500,
21  unsigned int interPacketGapUSeconds = 0);
22 
23  std::string sendAndReceive(Socket& toSocket,
24  const std::string& sendBuffer,
25  unsigned int timeoutSeconds = 1,
26  unsigned int timeoutUSeconds = 0,
27  bool verbose = false,
28  unsigned int interPacketTimeoutUSeconds = 10000);
29 
30  protected:
31  TransceiverSocket(void);
32 
33  private:
34  std::mutex sendAndReceiveMutex_;
35 };
36 
37 } // namespace ots
38 
39 #endif
int acknowledge(const std::string &buffer, bool verbose=false, size_t maxChunkSize=1500, unsigned int interPacketGapUSeconds=0)
acknowledge() responds to last receive location
std::string sendAndReceive(Socket &toSocket, const std::string &sendBuffer, unsigned int timeoutSeconds=1, unsigned int timeoutUSeconds=0, bool verbose=false, unsigned int interPacketTimeoutUSeconds=10000)
defines used also by OtsConfigurationWizardSupervisor