From 4eb0fab09b3185fcdffe462e14f96daab2a48481 Mon Sep 17 00:00:00 2001 From: qicosmos Date: Mon, 1 Jul 2019 11:04:09 +0800 Subject: [PATCH] fix for closed connection. --- include/connection.h | 4 ++++ 1 file changed, 4 insertions(+) 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(); }