void handle_write( const boost::system::error_code& error, size_t bytes_transferred ) { if (error) { close(); return; } m_write_buf.consume(bytes_transferred); //cout << "write complete" << endl; }
void handle_read(const boost::system::error_code& error, size_t bytes_transferred) { if (error) { close(); return; } //cout << "read size" << bytes_transferred << endl; m_read_buf.retrieve(bytes_transferred); //cout << string(m_read_buf.peek(), bytes_transferred) << endl; write(m_read_buf.peek(), bytes_transferred); m_read_buf.consume(bytes_transferred); read(); }