Set option via address.

This commit is contained in:
aljar 2020-11-13 18:05:07 +01:00
parent 11f1eaf2c3
commit fe1538e8ae
2 changed files with 3 additions and 5 deletions

View File

@ -192,9 +192,8 @@ public:
* Constructor
* @param handler User implemented handler object
* @param hostname The address to connect to
* @param random Randomly select one of the IP addresses that belong to the hostname
*/
TcpConnection(TcpHandler *handler, const Address &address, bool random = false);
TcpConnection(TcpHandler *handler, const Address &address);
/**
* No copying

View File

@ -23,11 +23,10 @@ namespace AMQP {
* Constructor
* @param handler User implemented handler object
* @param hostname The address to connect to
* @param random Randomly select one of the IP addresses that belong to the hostname
*/
TcpConnection::TcpConnection(TcpHandler *handler, const Address &address, bool random) :
TcpConnection::TcpConnection(TcpHandler *handler, const Address &address) :
_handler(handler),
_state(new TcpResolver(this, address.hostname(), address.port(), address.secure(), address.option("connectTimeout", 5), random)),
_state(new TcpResolver(this, address.hostname(), address.port(), address.secure(), address.option("connectTimeout", 5), address.option("randomConnect", false))),
_connection(this, address.login(), address.vhost())
{
// tell the handler