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();
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.
Static storage of an output device and its base (abstract) implementation.
bool has_client_connection() const
void connect()
Connects to host_:port_.
void send(const std::vector< unsigned char > &buffer)