diff --git a/win-linux/extras/update-daemon/src/classes/csocket.cpp b/win-linux/extras/update-daemon/src/classes/csocket.cpp index 792f5a8f8..2a56fafbe 100644 --- a/win-linux/extras/update-daemon/src/classes/csocket.cpp +++ b/win-linux/extras/update-daemon/src/classes/csocket.cpp @@ -210,7 +210,7 @@ void CSocket::CSocketPrv::postError(const char *error) m_error_callback(error); } -CSocket::CSocket(int sender_port, int receiver_port) : +CSocket::CSocket(int sender_port, int receiver_port, bool retry_connect) : pimpl(new CSocketPrv) { pimpl->m_sender_port = sender_port; @@ -218,7 +218,7 @@ CSocket::CSocket(int sender_port, int receiver_port) : return; pimpl->m_socket_created = pimpl->createSocket(receiver_port); pimpl->m_future = std::async(std::launch::async, [=]() { - while (pimpl->m_run && !pimpl->m_socket_created) { + while (retry_connect && pimpl->m_run && !pimpl->m_socket_created) { pimpl->postError("Unable to create socket, retrying after 4 seconds."); sleep(RETRIES_DELAY_MS); pimpl->m_socket_created = pimpl->createSocket(receiver_port); diff --git a/win-linux/extras/update-daemon/src/classes/csocket.h b/win-linux/extras/update-daemon/src/classes/csocket.h index 2a1f5e490..8b15eccc2 100644 --- a/win-linux/extras/update-daemon/src/classes/csocket.h +++ b/win-linux/extras/update-daemon/src/classes/csocket.h @@ -77,7 +77,7 @@ enum MsgCommands { class CSocket { public: - CSocket(int sender_port, int receiver_port); + CSocket(int sender_port, int receiver_port, bool retry_connect = true); ~CSocket(); /* callback */ diff --git a/win-linux/src/platform_linux/singleapplication.cpp b/win-linux/src/platform_linux/singleapplication.cpp index 0cd4d291c..093e1f2dc 100644 --- a/win-linux/src/platform_linux/singleapplication.cpp +++ b/win-linux/src/platform_linux/singleapplication.cpp @@ -39,7 +39,7 @@ SingleApplication::SingleApplication(int &argc, char *argv[], const QString&) : QApplication(argc, argv), - m_socket(new CSocket(0, INSTANCE_APP_PORT)) + m_socket(new CSocket(0, INSTANCE_APP_PORT, false)) { if (m_socket->isPrimaryInstance()) { m_isPrimary = true;