Skip to content

Commit

Permalink
[tests] Fixed async launch TestConnection.Multiple
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko committed Oct 13, 2021
1 parent 8bcf30b commit 6e89639
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/test_many_connections.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ class TestConnection
std::uniform_int_distribution<short> dis(-128, 127);
std::generate(m_buf.begin(), m_buf.end(), [dis, gen]() mutable { return (char)dis(gen); });

cout << "Generated: " << static_cast<int>(m_buf[0]) << ", " << static_cast<int>(m_buf[1]) << std::endl;

ASSERT_NE(srt_listen(m_server_sock, NSOCK), -1);
}

Expand Down Expand Up @@ -135,7 +133,7 @@ TEST_F(TestConnection, Multiple)
const sockaddr_in lsa = m_sa;
const sockaddr* psa = reinterpret_cast<const sockaddr*>(&lsa);

auto ex = std::async([this] { return AcceptLoop(); });
auto ex = std::async(std::launch::async, [this] { return AcceptLoop(); });

cerr << "Opening " << NSOCK << " connections\n";

Expand Down Expand Up @@ -180,6 +178,7 @@ TEST_F(TestConnection, Multiple)

cerr << "Synchronize with the accepting thread\n";
ex.wait();
cerr << "Synchronization done\n";
}


Expand Down

0 comments on commit 6e89639

Please sign in to comment.