Automatically reconnect client.

Also clean up some condition variable handling to make it more robust.
This commit is contained in:
Peter Johnson
2015-07-31 23:14:26 -07:00
parent a9af4589ac
commit 3a71acec52
3 changed files with 19 additions and 17 deletions

View File

@@ -100,6 +100,7 @@ void NetworkConnection::ReadThreadMain() {
}
m_process_incoming(std::move(msg), this, m_proto_rev);
}
DEBUG3("read thread died");
m_state = static_cast<int>(kDead);
m_active = false;
}
@@ -123,6 +124,7 @@ void NetworkConnection::WriteThreadMain() {
if (m_stream->send(encoder.data(), encoder.size(), &err) == 0) break;
DEBUG4("sent " << encoder.size() << " bytes");
}
DEBUG3("write thread died");
m_state = static_cast<int>(kDead);
m_active = false;
}