diff --git a/reflector/TCSocket.cpp b/reflector/TCSocket.cpp index 524430b..7f27a9d 100644 --- a/reflector/TCSocket.cpp +++ b/reflector/TCSocket.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -433,21 +434,19 @@ bool CTCClient::Connect(char module) return false; } -bool CTCClient::ReConnect() +void CTCClient::ReConnect() { - bool rv = false; for (char m : m_Modules) { - if (-1 == GetFD(m)) + if (0 > GetFD(m)) { std::cout << "Reconnecting module " << m << "..." << std::endl; if (Connect(m)) { - rv = true; + raise(SIGINT); } } } - return rv; } void CTCClient::Receive(std::queue> &queue, int ms) diff --git a/reflector/TCSocket.h b/reflector/TCSocket.h index 381e3ae..f6ffaac 100644 --- a/reflector/TCSocket.h +++ b/reflector/TCSocket.h @@ -73,7 +73,7 @@ public: ~CTCClient() {} bool Open(const std::string &address, const std::string &modules, uint16_t port); void Receive(std::queue> &queue, int ms); - bool ReConnect(); + void ReConnect(); private: std::string m_Address;