mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
Do not attemp to find random port for non-TCP protocols
This commit is contained in:
parent
fc7f6f1116
commit
f70201610b
|
@ -671,7 +671,6 @@ void FairMQChannel::Init()
|
||||||
bool FairMQChannel::ConnectEndpoint(const string& endpoint)
|
bool FairMQChannel::ConnectEndpoint(const string& endpoint)
|
||||||
{
|
{
|
||||||
lock_guard<mutex> lock(fMtx);
|
lock_guard<mutex> lock(fMtx);
|
||||||
|
|
||||||
return fSocket->Connect(endpoint);
|
return fSocket->Connect(endpoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -683,6 +682,13 @@ bool FairMQChannel::BindEndpoint(string& endpoint)
|
||||||
if (fSocket->Bind(endpoint)) {
|
if (fSocket->Bind(endpoint)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
// auto-bind only implemented for TCP
|
||||||
|
size_t protocolPos = endpoint.find(':');
|
||||||
|
string protocol = endpoint.substr(0, protocolPos);
|
||||||
|
if (protocol != "tcp") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (fAutoBind) {
|
if (fAutoBind) {
|
||||||
// number of attempts when choosing a random port
|
// number of attempts when choosing a random port
|
||||||
int numAttempts = 0;
|
int numAttempts = 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user