renamed ConnectionHandler::onConnectedO() to ConnectionHandler::onReady()

This commit is contained in:
Emiel Bruijntjes 2018-11-08 08:34:58 +01:00
parent 34f84e1ab7
commit da6744bf4d
6 changed files with 15 additions and 12 deletions

View File

@ -171,17 +171,19 @@ public:
* *
* @param connection The connection that can now be used * @param connection The connection that can now be used
*/ */
virtual void onConnected(Connection *connection) virtual void onReady(Connection *connection)
{ {
// make sure compilers dont complain about unused parameters // make sure compilers dont complain about unused parameters
(void) connection; (void) connection;
} }
/** /**
* Method that is called when the connection was closed. * Method that is called when the AMQP connection was closed.
* *
* This is the counter part of a call to Connection::close() and it confirms * This is the counter part of a call to Connection::close() and it confirms
* that the connection was _correctly_ closed. * that the connection was _correctly_ closed. Note that this only applies
* to the AMQP connection, the underlying TCP connection is not managed by
* AMQP-CPP and is still active.
* *
* @param connection The connection that was closed and that is now unusable * @param connection The connection that was closed and that is now unusable
*/ */

View File

@ -254,9 +254,9 @@ public:
} }
/** /**
* Mark the connection as connected * Mark the connection as ready
*/ */
void setConnected(); void setReady();
/** /**
* Retrieve the login data * Retrieve the login data

View File

@ -102,10 +102,10 @@ private:
virtual void onError(Connection *connection, const char *message) override; virtual void onError(Connection *connection, const char *message) override;
/** /**
* Method that is called when the connection is established * Method that is called when the AMQP connection is established
* @param connection The connection that can now be used * @param connection The connection that can now be used
*/ */
virtual void onConnected(Connection *connection) override virtual void onReady(Connection *connection) override
{ {
// pass on to the handler // pass on to the handler
_handler->onReady(this); _handler->onReady(this);

View File

@ -306,7 +306,7 @@ bool ConnectionImpl::sendClose()
/** /**
* Mark the connection as connected * Mark the connection as connected
*/ */
void ConnectionImpl::setConnected() void ConnectionImpl::setReady()
{ {
// store connected state // store connected state
_state = state_connected; _state = state_connected;
@ -316,7 +316,7 @@ void ConnectionImpl::setConnected()
Monitor monitor(this); Monitor monitor(this);
// inform handler // inform handler
_handler->onConnected(_parent); _handler->onReady(_parent);
// the handler could have destructed us // the handler could have destructed us
if (!monitor.valid()) return; if (!monitor.valid()) return;

View File

@ -4,7 +4,7 @@
* Message sent by the server to the client to confirm that a connection to * Message sent by the server to the client to confirm that a connection to
* a vhost could be established * a vhost could be established
* *
* @copyright 2014 Copernica BV * @copyright 2014 - 2018 Copernica BV
*/ */
/** /**
@ -79,8 +79,8 @@ public:
*/ */
virtual bool process(ConnectionImpl *connection) override virtual bool process(ConnectionImpl *connection) override
{ {
// all is ok, mark the connection as connected // all is ok, mark the connection as ready
connection->setConnected(); connection->setReady();
// done // done
return true; return true;

View File

@ -77,6 +77,7 @@ void TcpConnection::process(int fd, int flags)
// if the state did not change, we do not have to update a member, // if the state did not change, we do not have to update a member,
// when the newstate is nullptr, the object is (being) destructed // when the newstate is nullptr, the object is (being) destructed
// and we do not have to do anything else either // and we do not have to do anything else either
// @todo what if close(true) is called that install the new TcpClosed() ????
if (newstate == nullptr || newstate == _state.get()) return; if (newstate == nullptr || newstate == _state.get()) return;
// wrap the new state in a unique-ptr so that so that the old state // wrap the new state in a unique-ptr so that so that the old state