Added even more debug code for the channelimpl class

This commit is contained in:
Okke 2017-03-07 10:10:11 +01:00
parent 055431de6e
commit c6608cee0a
2 changed files with 28 additions and 2 deletions

View File

@ -213,6 +213,26 @@ public:
return _state == state_connected;
}
/**
* Are we closing down?
* @return bool
*/
bool closing() const
{
// state must be connected
return _state == state_closing;
}
/**
* Are we closed?
* @return bool
*/
bool closed() const
{
// state must be connected
return _state == state_closed;
}
/**
* Mark the connection as connected
*/

View File

@ -85,8 +85,14 @@ void ChannelImpl::onError(const ErrorCallback &callback)
// if the connection is valid, this is a pure channel error
if (_connection->connected()) return callback("Channel is in an error state, but the connection is valid");
// the connection is closing down
if (_connection->closing()) return callback("Channel is in an error state, the AMQP connection is closing down");
// the connection is already closed
if (_connection->closed()) return callback("Channel is in an error state, the AMQP connection has been closed");
// direct call if channel is already in error state
callback("Channel is in error state because no AMQP connection is available");
callback("Channel is in error state, something went wrong with the AMQP connection");
}
/**