43 for (
int wait = 1; wait < 10; wait += 1) {
51 std::this_thread::sleep_for(std::chrono::seconds(wait));
71 const std::string toSend =
myMessage.str();
73 if (toSend.empty() || !
mySocket->has_client_connection()) {
76 std::vector<unsigned char> msg;
77 msg.insert(msg.end(), toSend.begin(), toSend.end());
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
OutputDevice_Network(const std::string &host, const int port)
Constructor.
~OutputDevice_Network()
Destructor.
tcpip::Socket * mySocket
the socket to transfer the data
std::ostringstream myMessage
packet buffer
std::ostream & getOStream()
Returns the associated ostream.
virtual void postWriteHook()
Sends the data which was written to the string stream over the socket.
OutputDevice(const int defaultIndentation=0, const std::string &filename="")
Constructor.