summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/ConnectionImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/client/ConnectionImpl.cpp')
-rw-r--r--cpp/src/qpid/client/ConnectionImpl.cpp3
1 files changed, 2 insertions, 1 deletions
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() {