From 077992f5b43f5ba7f70dce22de05b56b36107073 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Sun, 4 May 2008 16:39:22 +0000 Subject: Fix error handling for connection close during startup. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@653248 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/client/ConnectionImpl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cpp/src/qpid/client/ConnectionImpl.cpp') diff --git a/cpp/src/qpid/client/ConnectionImpl.cpp b/cpp/src/qpid/client/ConnectionImpl.cpp index 643d42403d..67ae2293f1 100644 --- a/cpp/src/qpid/client/ConnectionImpl.cpp +++ b/cpp/src/qpid/client/ConnectionImpl.cpp @@ -48,12 +48,13 @@ ConnectionImpl::ConnectionImpl(framing::ProtocolVersion v, const ConnectionSetti handler.out = boost::bind(&Connector::send, boost::ref(connector), _1); handler.onClose = boost::bind(&ConnectionImpl::closed, this, NORMAL, std::string()); - handler.onError = boost::bind(&ConnectionImpl::closed, this, _1, _2); connector.setInputHandler(&handler); connector.setTimeoutHandler(this); connector.setShutdownHandler(this); open(settings.host, settings.port); + //only set error handler once open + handler.onError = boost::bind(&ConnectionImpl::closed, this, _1, _2); } ConnectionImpl::~ConnectionImpl() { -- cgit v1.2.1