do_launch_request is not used in client.cc
Closed this issue · 1 comments
asias commented
future<> do_launch_request() {
net::fragment frag { const_cast<char*>(str_txbuf.c_str()), buf_size };
net::packet pack(frag, deleter());
return _out.write(std::move(pack)).then([this] {
return _out.flush();
}).then([this] {
return _in.read_exactly(buf_size).then([this] (auto&& data) {
_nr_done++;
if (_echo_client.done(_nr_done)) {
return make_ready_future<>();
}
return this->do_launch_request();
});
});
}
shanshanpt commented
@asias Not use the function.
The run() function will execute keep_doing_read and keep_doing_write directly.
// read
keep_doing([conn, this] () {
return conn->_in.read_exactly(buf_size).then([this] (auto&& data) {
});
}).then([conn] {
conn->_out.close();
});
// write
keep_doing([conn, this] () {
net::fragment frag { const_cast<char*>(str_txbuf.c_str()), buf_size };
net::packet pack(frag, deleter());
return conn->_out.write(std::move(pack)).then([this, conn] {
conn->_out.flush();
});
}).then([conn] {
conn->_out.close();
});