aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2019-11-29 16:34:11 +0100
committerMauro Sardara <msardara@cisco.com>2019-11-29 16:02:59 +0000
commit764972999cda0b11d431c581072610f6c62dcacb (patch)
treeb11f0de1163ac48cdac71f562f04397d0cc89cd7 /libtransport
parentfbd866f9abc43217f7d214907d784f75f1db6175 (diff)
[HICN-423] Handle exception of producer socket thrown upon socket disposing.
Change-Id: I2458d054150ca307cf7ac0391f7698ebf2e7466e Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'libtransport')
-rw-r--r--libtransport/src/hicn/transport/core/udp_socket_connector.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/libtransport/src/hicn/transport/core/udp_socket_connector.cc b/libtransport/src/hicn/transport/core/udp_socket_connector.cc
index 38945e755..99f47fedf 100644
--- a/libtransport/src/hicn/transport/core/udp_socket_connector.cc
+++ b/libtransport/src/hicn/transport/core/udp_socket_connector.cc
@@ -62,7 +62,13 @@ void UdpSocketConnector::send(const uint8_t *packet, std::size_t len,
});
} else {
if (state_ == ConnectorState::CONNECTED) {
- socket_.send(asio::buffer(packet, len));
+ try {
+ socket_.send(asio::buffer(packet, len));
+ } catch (std::system_error &err) {
+ TRANSPORT_LOGE(
+ "Sending of disconnect message to forwarder failed. Reason: %s",
+ err.what());
+ }
}
}
}