From fe1538e8ae2e6a7a15fcfee0f8f11b6c4f0deef3 Mon Sep 17 00:00:00 2001 From: aljar Date: Fri, 13 Nov 2020 18:05:07 +0100 Subject: [PATCH] Set option via address. --- include/amqpcpp/linux_tcp/tcpconnection.h | 3 +-- src/linux_tcp/tcpconnection.cpp | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/amqpcpp/linux_tcp/tcpconnection.h b/include/amqpcpp/linux_tcp/tcpconnection.h index 6167f79..a8dae17 100644 --- a/include/amqpcpp/linux_tcp/tcpconnection.h +++ b/include/amqpcpp/linux_tcp/tcpconnection.h @@ -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 diff --git a/src/linux_tcp/tcpconnection.cpp b/src/linux_tcp/tcpconnection.cpp index 316fd0e..70b4035 100644 --- a/src/linux_tcp/tcpconnection.cpp +++ b/src/linux_tcp/tcpconnection.cpp @@ -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