Exposed the channels method in the TcpConnection class and added a more specialized constructor to the Address class
This commit is contained in:
parent
c2c62562e7
commit
875300dbce
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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