From 9231b44bd2e7843d4b44f4ef5aac8ae5f6e399af Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Tue, 28 Apr 2009 20:57:58 +0000 Subject: Ensure socket is closed when exception occurs during encode/decode. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@769532 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/client/Connector.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'qpid/cpp/src') diff --git a/qpid/cpp/src/qpid/client/Connector.cpp b/qpid/cpp/src/qpid/client/Connector.cpp index c251233082..fa2c75429f 100644 --- a/qpid/cpp/src/qpid/client/Connector.cpp +++ b/qpid/cpp/src/qpid/client/Connector.cpp @@ -391,11 +391,13 @@ void TCPConnector::run() { aio->start(poller); d.run(); - socket.close(); } catch (const std::exception& e) { QPID_LOG(error, QPID_MSG("FAIL " << identifier << ": " << e.what())); handleClosed(); } + try { + socket.close(); + } catch (const std::exception& e) {} } void TCPConnector::activateSecurityLayer(std::auto_ptr sl) -- cgit v1.2.1