Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed May 3, 2017
1 parent 3c0a23d commit 8d5156d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/rpc/client.cc
Expand Up @@ -165,8 +165,13 @@ client::client(std::string const &addr, uint16_t port)

void client::wait_conn() {
std::unique_lock<std::mutex> lock(pimpl->mut_connection_finished_);

if (!pimpl->is_connected_) {
pimpl->conn_finished_.wait(lock);
auto timeout2=std::chrono::milliseconds(pimpl->timeout_);
auto result=pimpl->conn_finished_.wait_for(lock, timeout2);
if(result == std::cv_status::timeout){
throw_timeout("rpc::client::wait_conn timed out");
}
}
}

Expand Down

0 comments on commit 8d5156d

Please sign in to comment.