diff options
author | Michele Papalini <micpapal@cisco.com> | 2019-12-02 09:59:23 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2019-12-02 09:59:23 +0000 |
commit | 5822f2e2d52c3f471b91e526b9404146e038ef1b (patch) | |
tree | c17319916d7d08117c3f6b3be0aa8e2c0ab9ae14 | |
parent | b8da5e880fe199978aeb27dc5a466435d6389775 (diff) | |
parent | 764972999cda0b11d431c581072610f6c62dcacb (diff) |
Merge "[HICN-423] Handle exception of producer socket thrown upon socket disposing."
-rw-r--r-- | libtransport/src/hicn/transport/core/udp_socket_connector.cc | 8 |
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()); + } } } } |