Merge branch 'master' of https://github.com/CopernicaMarketingSoftware/AMQP-CPP
This commit is contained in:
commit
fd2a1fd604
|
|
@ -109,6 +109,17 @@ public:
|
||||||
* @param address
|
* @param address
|
||||||
*/
|
*/
|
||||||
Address(const std::string &address) : Address(address.data()) {}
|
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
|
* Destructor
|
||||||
|
|
@ -161,7 +172,7 @@ public:
|
||||||
std::string str("amqp://");
|
std::string str("amqp://");
|
||||||
|
|
||||||
// append login
|
// 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?
|
// do we need a special portnumber?
|
||||||
if (_port != 5672) str.append(":").append(std::to_string(_port));
|
if (_port != 5672) str.append(":").append(std::to_string(_port));
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,16 @@ public:
|
||||||
// pass to the underlying connection
|
// pass to the underlying connection
|
||||||
return _connection.close();
|
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();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue