add remote_address interface

This commit is contained in:
qicosmos
2019-06-13 20:24:38 +08:00
parent 8f908e777b
commit 985c4f6df1
+5 -1
View File
@@ -69,6 +69,10 @@ namespace rest_rpc {
return body_;
}
std::string remote_address() const {
return socket_.remote_endpoint().address().to_string();
}
private:
void read_head() {
reset_timer();
@@ -167,7 +171,7 @@ namespace rest_rpc {
auto self(this->shared_from_this());
timer_.expires_from_now(std::chrono::seconds(timeout_seconds_));
timer_.async_wait([this, self](const boost::system::error_code & ec) {
timer_.async_wait([this, self](const boost::system::error_code& ec) {
if (has_closed()) { return; }
if (ec) { return; }