Skip error message only for tcp

This commit is contained in:
Giulio Eulisse 2022-02-28 15:53:03 +01:00 committed by Alexey Rybalchenko
parent 29827f0426
commit fa0bf96eb2

View File

@ -27,7 +27,11 @@ inline bool Bind(void* socket, const std::string& address, const std::string& id
if (errno == EADDRINUSE) { if (errno == EADDRINUSE) {
// do not print error in this case, this is handled upstream in case no // 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. // 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) { } else if (errno == EACCES) {
// check if TCP port 1 was given, if yes then it will be handeled upstream, print debug only // check if TCP port 1 was given, if yes then it will be handeled upstream, print debug only
size_t protocolPos = address.find(':'); size_t protocolPos = address.find(':');