1 #ifndef _ots_TransceiverSocket_h_
2 #define _ots_TransceiverSocket_h_
4 #include "otsdaq/NetworkUtilities/ReceiverSocket.h"
5 #include "otsdaq/NetworkUtilities/TransmitterSocket.h"
23 size_t maxChunkSize = 1500,
24 unsigned int interPacketGapUSeconds = 0,
25 bool enableRetransmission =
false);
40 int sendAll(
const std::string& buffer,
42 size_t maxChunkSize = 65500,
43 unsigned int interPacketGapUSeconds = 0);
51 unsigned int timeoutSeconds = 5,
52 unsigned int retransmitMaxRetries = 10,
53 bool verbose =
false);
56 const std::string& sendBuffer,
57 unsigned int timeoutSeconds = 1,
58 unsigned int timeoutUSeconds = 0,
60 unsigned int interPacketTimeoutUSeconds = 10000);
71 const std::string& sendBuffer,
72 unsigned int timeoutSeconds = 5,
73 unsigned int retransmitMaxRetries = 10,
74 bool verbose =
false);
78 static constexpr
size_t RETRANSMIT_HEADER_SIZE = 8;
84 std::mutex sendAndReceiveMutex_;
int acknowledge(const std::string &buffer, bool verbose=false, size_t maxChunkSize=1500, unsigned int interPacketGapUSeconds=0, bool enableRetransmission=false)
std::string sendAndReceiveAll(Socket &toSocket, const std::string &sendBuffer, unsigned int timeoutSeconds=5, unsigned int retransmitMaxRetries=10, bool verbose=false)
static constexpr uint16_t RETRANSMIT_MAGIC
Retransmission protocol constants.
int sendAll(const std::string &buffer, bool verbose=false, size_t maxChunkSize=65500, unsigned int interPacketGapUSeconds=0)
std::string sendAndReceive(Socket &toSocket, const std::string &sendBuffer, unsigned int timeoutSeconds=1, unsigned int timeoutUSeconds=0, bool verbose=false, unsigned int interPacketTimeoutUSeconds=10000)
int receiveAll(std::string &buffer, unsigned int timeoutSeconds=5, unsigned int retransmitMaxRetries=10, bool verbose=false)
defines used also by OtsConfigurationWizardSupervisor