Skip to content

Commit 07d3acd

Browse files
authored
give sync file a name (#158)
1 parent 75ddd5f commit 07d3acd

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

co_sim_io/impl/communication/file_communication.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class FileCommunication : public Communication
8181
}
8282
}
8383

84-
ExchangeSyncFileWithPartner();
84+
ExchangeSyncFileWithPartner("connect");
8585

8686
Info info;
8787
info.Set("is_connected", true);
@@ -90,7 +90,7 @@ class FileCommunication : public Communication
9090

9191
Info DisconnectDetail(const Info& I_Info) override
9292
{
93-
ExchangeSyncFileWithPartner();
93+
ExchangeSyncFileWithPartner("disconnect");
9494

9595
if (mCommInFolder && GetIsPrimaryConnection()) {
9696
// delete directory to remove potential leftovers
@@ -106,10 +106,10 @@ class FileCommunication : public Communication
106106
return info;
107107
}
108108

109-
void ExchangeSyncFileWithPartner() const
109+
void ExchangeSyncFileWithPartner(const std::string& rIdentifier) const
110110
{
111-
const fs::path file_name_primary(GetFileName("CoSimIO_primary_connect_" + GetConnectionName(), "sync"));
112-
const fs::path file_name_secondary(GetFileName("CoSimIO_secondary_connect_" + GetConnectionName(), "sync"));
111+
const fs::path file_name_primary(GetFileName("CoSimIO_primary_" + rIdentifier + "_" + GetConnectionName(), "sync"));
112+
const fs::path file_name_secondary(GetFileName("CoSimIO_secondary_" + rIdentifier + "_" + GetConnectionName(), "sync"));
113113

114114
if (GetIsPrimaryConnection()) {
115115
std::ofstream sync_file;

0 commit comments

Comments
 (0)