Exposed the channels method in the TcpConnection class and added a more specialized constructor to the Address class

This commit is contained in:
Toon Schoenmakers 2015-11-02 17:47:21 +01:00
parent c2c62562e7
commit 875300dbce
2 changed files with 21 additions and 0 deletions

View File

@ -109,6 +109,17 @@ public:
* @param address
*/
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

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();
}
};
/**