Skip to content

Commit

Permalink
DHS protocol - multiple hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
danovaro committed Jan 4, 2024
1 parent 4b8c28c commit 36406fd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/metkit/mars/DHSProtocol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,19 @@ DHSProtocol::DHSProtocol(const Configuration& params):
BaseProtocol(params),
callback_(BaseCallbackConnection::build(params)),
name_(params.getString("name")),
host_(params.getString("host")),
port_(params.getInt("port", 9000)),
done_(false),
error_(false),
sending_(false),
forward_(false)
{
if (params.has("hosts")) {
std::vector<std::string> hosts = params.getStringVector("hosts");
host_ = hosts.at(std::rand() % hosts.size());
} else {
ASSERT(params.has("host"));
host_ = params.getString("host");
}
}

DHSProtocol::DHSProtocol(Stream& s):
Expand Down

0 comments on commit 36406fd

Please sign in to comment.