Skip to content

Commit b22c4ed

Browse files
committed
Use socket connection parameters also for primary client
1 parent d57df32 commit b22c4ed

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

include/ur_client_library/primary/primary_client.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ class PrimaryClient
6666
* \param primary_consumer Primary consumer that should be removed from the list
6767
*/
6868
void removePrimaryConsumer(std::shared_ptr<comm::IConsumer<PrimaryPackage>> primary_consumer);
69-
void start();
69+
void start(const size_t max_num_tries = 0,
70+
const std::chrono::milliseconds reconnection_time = urcl::comm::TCPSocket::DEFAULT_RECONNECTION_TIME);
7071

7172
/*!
7273
* \brief Retrieves previously raised error codes from PrimaryClient. After calling this, recorded errors will be

src/primary/primary_client.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ PrimaryClient::~PrimaryClient()
6060
pipeline_->stop();
6161
}
6262

63-
void PrimaryClient::start()
63+
void PrimaryClient::start(const size_t max_num_tries, const std::chrono::milliseconds reconnection_time)
6464
{
6565
URCL_LOG_INFO("Starting primary client pipeline");
66-
pipeline_->init();
66+
pipeline_->init(max_num_tries, reconnection_time);
6767
pipeline_->run();
6868
}
6969

src/ur/ur_driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ void UrDriver::setupReverseInterface(const uint32_t reverse_port)
708708

709709
void UrDriver::startPrimaryClientCommunication()
710710
{
711-
primary_client_->start();
711+
primary_client_->start(socket_connection_attempts_, socket_reconnection_timeout_);
712712
}
713713

714714
std::deque<urcl::primary_interface::ErrorCode> UrDriver::getErrorCodes()

0 commit comments

Comments
 (0)