Skip to content
Closed
Show file tree
Hide file tree
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
14 changes: 13 additions & 1 deletion co_sim_io/includes/communication/base_socket_communication.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,19 @@ class CO_SIM_IO_API BaseSocketCommunication : public Communication
std::shared_ptr<DataCommunicator> I_DataComm)
: Communication(I_Settings, I_DataComm) {}

~BaseSocketCommunication() override;
/// Destructor
~BaseSocketCommunication() override
{
CO_SIM_IO_TRY

if (GetIsConnected()) {
CO_SIM_IO_INFO("CoSimIO") << "Warning: Disconnect was not performed, attempting automatic disconnection!" << std::endl;
Info tmp;
Disconnect(tmp);
}

CO_SIM_IO_CATCH
}

Info ConnectDetail(const Info& I_Info) override;

Expand Down
14 changes: 0 additions & 14 deletions co_sim_io/sources/communication/base_socket_communication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,6 @@
namespace CoSimIO {
namespace Internals {

template<class TSocketType>
BaseSocketCommunication<TSocketType>::~BaseSocketCommunication()
{
CO_SIM_IO_TRY

if (GetIsConnected()) {
CO_SIM_IO_INFO("CoSimIO") << "Warning: Disconnect was not performed, attempting automatic disconnection!" << std::endl;
Info tmp;
Disconnect(tmp);
}

CO_SIM_IO_CATCH
}

template<class TSocketType>
Info BaseSocketCommunication<TSocketType>::ConnectDetail(const Info& I_Info)
{
Expand Down
Loading