diff --git a/include/connection.h b/include/connection.h index cc2891b..147f257 100644 --- a/include/connection.h +++ b/include/connection.h @@ -70,6 +70,10 @@ namespace rest_rpc { } std::string remote_address() const { + if (has_closed_) { + return ""; + } + return socket_.remote_endpoint().address().to_string(); }