diff --git a/fairmq/FairMQChannel.cxx b/fairmq/FairMQChannel.cxx index 417f183c..88280189 100644 --- a/fairmq/FairMQChannel.cxx +++ b/fairmq/FairMQChannel.cxx @@ -390,17 +390,6 @@ bool FairMQChannel::ValidateChannel() exit(EXIT_FAILURE); } - // validate socket method - const string socketMethodNames[] = { "bind", "connect" }; - const set socketMethods(socketMethodNames, socketMethodNames + sizeof(socketMethodNames) / sizeof(string)); - if (socketMethods.find(fMethod) == socketMethods.end()) - { - ss << "INVALID"; - LOG(DEBUG) << ss.str(); - LOG(ERROR) << "Invalid channel method: \"" << fMethod << "\""; - exit(EXIT_FAILURE); - } - // validate socket address if (fAddress == "unspecified" || fAddress == "") { @@ -421,7 +410,17 @@ bool FairMQChannel::ValidateChannel() if (endpoint[0]=='@'||endpoint[0]=='+'||endpoint[0]=='>') { address = endpoint.substr(1); } else { - address = endpoint; + // we don't have a method modifier, check if the default method is set + const string socketMethodNames[] = { "bind", "connect" }; + const set socketMethods(socketMethodNames, socketMethodNames + sizeof(socketMethodNames) / sizeof(string)); + if (socketMethods.find(fMethod) == socketMethods.end()) + { + ss << "INVALID"; + LOG(DEBUG) << ss.str(); + LOG(ERROR) << "Invalid endpoint connection method: \"" << fMethod << "\" for " << endpoint; + exit(EXIT_FAILURE); + } + address = endpoint; } // check if address is a tcp or ipc address if (address.compare(0, 6, "tcp://") == 0) diff --git a/fairmq/FairMQDevice.cxx b/fairmq/FairMQDevice.cxx index 5776e1b4..27dc7bc0 100644 --- a/fairmq/FairMQDevice.cxx +++ b/fairmq/FairMQDevice.cxx @@ -208,6 +208,15 @@ void FairMQDevice::InitWrapper() // fill the uninitialized list uninitializedConnectingChannels.push_back(&(*vi)); } + else if (vi->fAddress.find_first_of("@+>") != string::npos) + { + // set channel name: name + vector index + stringstream ss; + ss << mi->first << "[" << vi - (mi->second).begin() << "]"; + vi->fChannelName = ss.str(); + // fill the uninitialized list + uninitializedConnectingChannels.push_back(&(*vi)); + } else { LOG(ERROR) << "Cannot update configuration. Socket method (bind/connect) not specified.";