This commit is contained in:
Emiel Bruijntjes 2015-11-04 13:05:15 +01:00
commit fd2a1fd604
2 changed files with 22 additions and 1 deletions

View File

@ -110,6 +110,17 @@ public:
*/
Address(const std::string &address) : Address(address.data()) {}
/**
* Constructor based on already known properties
* @param host
* @param port
* @param login
* @param vhost
*/
Address(std::string host, uint16_t port, Login login, std::string vhost) : _login(std::move(login)),
_hostname(std::move(host)),
_port(port), _vhost(std::move(vhost)) {}
/**
* Destructor
*/
@ -161,7 +172,7 @@ public:
std::string str("amqp://");
// append login
str.append(_login.user()).append("@").append(_login.password()).append("@").append(_hostname);
str.append(_login.user()).append(":").append(_login.password()).append("@").append(_hostname);
// do we need a special portnumber?
if (_port != 5672) str.append(":").append(std::to_string(_port));

View File

@ -123,6 +123,16 @@ public:
// pass to the underlying connection
return _connection.close();
}
/**
* Return the amount of channels this connection has
* @return std::size_t
*/
std::size_t channels() const
{
// return the amount of channels this connection has
return _connection.channels();
}
};
/**