ZMQ: fixed connect detection

It could give false negative if the connection took >= 1000 ms.
This commit is contained in:
SChernykh 2025-03-22 21:44:07 +01:00
parent 55e12a3715
commit 8b4b06f1be

View file

@ -231,6 +231,9 @@ bool ZMQReader::connect(const std::string& address, bool keep_monitor)
m_subscriber.connect(address);
while (!monitor->m_connected && monitor->check_event(-1)) {
if (monitor->m_connected) {
break;
}
if (duration_cast<milliseconds>(steady_clock::now() - start_time).count() >= 1000) {
LOGERR(1, "failed to connect to " << address);
delete monitor;