@@ -961,7 +961,7 @@ void split(const std::string& str, Container& cont)
961961}
962962} // namespace
963963
964- void DeviceSpecHelpers::prepareArguments (bool defaultQuiet, bool defaultStopped,
964+ void DeviceSpecHelpers::prepareArguments (bool defaultQuiet, bool defaultStopped, unsigned short driverPort,
965965 std::vector<DataProcessorInfo> const & processorInfos,
966966 std::vector<DeviceSpec> const & deviceSpecs,
967967 std::vector<DeviceExecution>& deviceExecutions,
@@ -1037,6 +1037,7 @@ void DeviceSpecHelpers::prepareArguments(bool defaultQuiet, bool defaultStopped,
10371037 // has option --session been specified on the command line?
10381038 bool haveSessionArg = false ;
10391039 using FilterFunctionT = std::function<void (decltype (argc), decltype (argv), decltype (od))>;
1040+ bool useDefaultWS = false ;
10401041
10411042 // the filter function will forward command line arguments based on the option
10421043 // definition passed to it. All options of the program option definition will be forwarded
@@ -1109,6 +1110,7 @@ void DeviceSpecHelpers::prepareArguments(bool defaultQuiet, bool defaultStopped,
11091110 }
11101111
11111112 haveSessionArg = haveSessionArg || varmap.count (" session" ) != 0 ;
1113+ useDefaultWS = useDefaultWS || (varmap.count (" driver-client-backend" ) != 0 ) && varmap[" driver-client-backend" ].as <std::string>() == " ws://" ;
11121114
11131115 for (const auto varit : varmap) {
11141116 // find the option belonging to key, add if the option has been parsed
@@ -1160,6 +1162,16 @@ void DeviceSpecHelpers::prepareArguments(bool defaultQuiet, bool defaultStopped,
11601162 tmpArgs.emplace_back (std::string (" --session" ));
11611163 tmpArgs.emplace_back (" dpl_" + uniqueWorkflowId);
11621164 }
1165+ // In case we use only ws://, we need to expand the address
1166+ // with the correct port.
1167+ if (useDefaultWS) {
1168+ auto it = std::find (tmpArgs.begin (), tmpArgs.end (), " --driver-client-backend" );
1169+ if ((it != tmpArgs.end ()) && (it + 1 != tmpArgs.end ())) {
1170+ tmpArgs.erase (it, it + 2 );
1171+ }
1172+ tmpArgs.emplace_back (std::string (" --driver-client-backend" ));
1173+ tmpArgs.emplace_back (" ws://0.0.0.0:" + std::to_string (driverPort));
1174+ }
11631175
11641176 if (spec.resourceMonitoringInterval > 0 ) {
11651177 tmpArgs.emplace_back (std::string (" --resources-monitoring" ));
0 commit comments