diff --git a/include/amqpcpp/connectionhandler.h b/include/amqpcpp/connectionhandler.h index ef3537e..acf7f10 100644 --- a/include/amqpcpp/connectionhandler.h +++ b/include/amqpcpp/connectionhandler.h @@ -41,38 +41,6 @@ public: */ virtual ~ConnectionHandler() = default; - /** - * Method that is called immediately after a connection has been attached - * to the handler. This method is called right after the connection object - * was constructed. You can override this method if you want to initialize - * your handler for this specific connection. This is especially useful if - * you use your handler to deal with multiple connections, and cannot use - * the constructor for initialization. - * - * @param connection The connection object that was just constructed - */ - virtual void onAttached(Connection *connection) - { - // make sure compilers dont complain about unused parameters - (void) connection; - } - - /** - * Method that is called right before a connection object is destructed. - * This is the counterpart of the onAttached() method. - * - * Wacht out: the connection object that is passed to this method is in - * the process of being destructed, which makes it unsafe to call any - * methods on it. - * - * @param connection The connection that is being destructed - */ - virtual void onDetached(Connection *connection) - { - // make sure compilers dont complain about unused parameters - (void) connection; - } - /** * Method that is called when the heartbeat frequency is negotiated * between the server and the client durion connection setup. You diff --git a/include/amqpcpp/linux_tcp/tcpconnection.h b/include/amqpcpp/linux_tcp/tcpconnection.h index 68d5766..411815d 100644 --- a/include/amqpcpp/linux_tcp/tcpconnection.h +++ b/include/amqpcpp/linux_tcp/tcpconnection.h @@ -53,26 +53,6 @@ private: */ Connection _connection; - /** - * Method that is called after the connection was constructed - * @param connection The connection that was attached to the handler - */ - virtual void onAttached(Connection *connection) override - { - // pass on to the handler - _handler->onAttached(this); - } - - /** - * Method that is called when the connection is destructed - * @param connection The connection that was detached from the handler - */ - virtual void onDetached(Connection *connection) override - { - // pass on to the handler - _handler->onDetached(this); - } - /** * Method that is called when the heartbeat frequency is negotiated. * @param connection The connection that suggested a heartbeat interval diff --git a/src/connectionimpl.cpp b/src/connectionimpl.cpp index 3df2d15..e4483b9 100644 --- a/src/connectionimpl.cpp +++ b/src/connectionimpl.cpp @@ -34,9 +34,6 @@ namespace AMQP { ConnectionImpl::ConnectionImpl(Connection *parent, ConnectionHandler *handler, const Login &login, const std::string &vhost) : _parent(parent), _handler(handler), _login(login), _vhost(vhost) { - // tell the handler that it is attached to this connection - _handler->onAttached(_parent); - // we need to send a protocol header send(ProtocolHeaderFrame()); } @@ -51,9 +48,6 @@ ConnectionImpl::~ConnectionImpl() // invalidate all channels, so they will no longer call methods on this channel object for (auto iter = _channels.begin(); iter != _channels.end(); iter++) iter->second->detach(); - - // tell the handler that it is no longer attached to this connection - _handler->onDetached(_parent); } /**