From 764972999cda0b11d431c581072610f6c62dcacb Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Fri, 29 Nov 2019 16:34:11 +0100 Subject: [HICN-423] Handle exception of producer socket thrown upon socket disposing. Change-Id: I2458d054150ca307cf7ac0391f7698ebf2e7466e Signed-off-by: Mauro Sardara --- libtransport/src/hicn/transport/core/udp_socket_connector.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libtransport/src') 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()); + } } } } -- cgit 1.2.3-korg