mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 16:46:47 +00:00
AttachChannel must update the config after it's done, use boost::split
This commit is contained in:
parent
0fb49a0986
commit
6c3b01f09c
|
@ -14,6 +14,8 @@
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
|
#include <boost/algorithm/string.hpp> // join/split
|
||||||
|
|
||||||
#include "FairMQChannel.h"
|
#include "FairMQChannel.h"
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
|
|
||||||
|
@ -784,13 +786,5 @@ FairMQChannel::~FairMQChannel()
|
||||||
|
|
||||||
void FairMQChannel::Tokenize(vector<string>& output, const string& input, const string delimiters)
|
void FairMQChannel::Tokenize(vector<string>& output, const string& input, const string delimiters)
|
||||||
{
|
{
|
||||||
size_t start = 0;
|
boost::algorithm::split(output, input, boost::algorithm::is_any_of(delimiters));
|
||||||
size_t end = input.find_first_of(delimiters);
|
|
||||||
while (end != string::npos)
|
|
||||||
{
|
|
||||||
output.push_back(input.substr(start, end-start));
|
|
||||||
start = ++end;
|
|
||||||
end = input.find_first_of(delimiters, start);
|
|
||||||
}
|
|
||||||
output.push_back(input.substr(start));
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,8 @@
|
||||||
#include <termios.h> // for the InteractiveStateLoop
|
#include <termios.h> // for the InteractiveStateLoop
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
|
|
||||||
|
#include <boost/algorithm/string.hpp> // join/split
|
||||||
|
|
||||||
#include "FairMQSocket.h"
|
#include "FairMQSocket.h"
|
||||||
#include "FairMQDevice.h"
|
#include "FairMQDevice.h"
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
|
@ -348,6 +350,10 @@ bool FairMQDevice::AttachChannel(FairMQChannel& ch)
|
||||||
// after the book keeping is done, exit in case of errors
|
// after the book keeping is done, exit in case of errors
|
||||||
if (!rc) return rc;
|
if (!rc) return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// put the (possibly) modified address back in the config
|
||||||
|
ch.UpdateAddress(boost::algorithm::join(endpoints, ","));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user