Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions concoredocker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class Concore {

std::vector<std::string> read(int port, const std::string& name, const std::string& initstr) {
std::this_thread::sleep_for(std::chrono::seconds(delay));
std::string file_path = inpath + std::to_string(port) + "/" + name;
std::string file_path = inpath + "/" + std::to_string(port) + "/" + name;
std::ifstream infile(file_path);
std::string ins;

Expand All @@ -94,6 +94,7 @@ class Concore {
int attempts = 0, max_retries = 5;
while (ins.empty() && attempts < max_retries) {
std::this_thread::sleep_for(std::chrono::seconds(delay));
infile.close();
infile.open(file_path);
if (infile) std::getline(infile, ins);
attempts++;
Expand All @@ -110,7 +111,7 @@ class Concore {
}

void write(int port, const std::string& name, const std::vector<std::string>& val, int delta = 0) {
std::string file_path = outpath + std::to_string(port) + "/" + name;
std::string file_path = outpath + "/" + std::to_string(port) + "/" + name;
std::ofstream outfile(file_path);
if (!outfile) {
std::cerr << "Error writing to " << file_path << "\n";
Expand Down