mirror of
https://github.com/SChernykh/p2pool.git
synced 2025-04-01 11:49:04 +00:00
ZMQ: fixed connect detection
It could give false negative if the connection took >= 1000 ms.
This commit is contained in:
parent
55e12a3715
commit
8b4b06f1be
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue