From fa0bf96eb2a7bb81639254f3ddcbf6b8fa3ae719 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Mon, 28 Feb 2022 15:53:03 +0100 Subject: [PATCH] Skip error message only for tcp --- fairmq/zeromq/Common.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fairmq/zeromq/Common.h b/fairmq/zeromq/Common.h index f5bce913..7bce2632 100644 --- a/fairmq/zeromq/Common.h +++ b/fairmq/zeromq/Common.h @@ -27,7 +27,11 @@ inline bool Bind(void* socket, const std::string& address, const std::string& id if (errno == EADDRINUSE) { // do not print error in this case, this is handled upstream in case no // connection could be established after trying a number of random ports from a range. - return false; + size_t protocolPos = address.find(':'); + std::string protocol = address.substr(0, protocolPos); + if (protocol == "tcp") { + return false; + } } else if (errno == EACCES) { // check if TCP port 1 was given, if yes then it will be handeled upstream, print debug only size_t protocolPos = address.find(':');