From f4de68cb2234b0afb56618b2a470c8eb60f9483c Mon Sep 17 00:00:00 2001 From: orignal Date: Sat, 31 Dec 2016 10:50:48 -0500 Subject: [PATCH] avoid exception if not connected --- I2PTunnel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/I2PTunnel.cpp b/I2PTunnel.cpp index ff3e06a3..e94b5ed4 100644 --- a/I2PTunnel.cpp +++ b/I2PTunnel.cpp @@ -92,7 +92,8 @@ namespace client m_Stream->Close (); m_Stream.reset (); } - m_Socket->shutdown(boost::asio::ip::tcp::socket::shutdown_send); // avoid RST + boost::system::error_code ec; + m_Socket->shutdown(boost::asio::ip::tcp::socket::shutdown_send, ec); // avoid RST m_Socket->close (); Done(shared_from_this ());