Skip to content
This repository has been archived by the owner on Apr 6, 2019. It is now read-only.

fix race condition in tcp_client::connect #3

Merged
merged 1 commit into from
Nov 27, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions sources/network/tcp_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ tcp_client::connect(const std::string& host, unsigned int port) {

//! async connect
m_socket.async_connect(endpoint, [&](boost::system::error_code error) {
conn_cond_var.notify_one();

if (not error) {
m_is_connected = true;
async_read();
}
conn_cond_var.notify_one();
});

//! start loop and wait for async connect result
Expand Down