|
@@ -55,13 +55,6 @@ void make_connections(bool& party, const std::string host1,
|
|
#if (PARTY == 0)
|
|
#if (PARTY == 0)
|
|
|
|
|
|
party = false;
|
|
party = false;
|
|
- for(size_t j = 0; j < number_of_sockets; ++j)
|
|
|
|
- {
|
|
|
|
- tcp::socket sb_a(io_context);
|
|
|
|
- boost::asio::connect(sb_a, resolver.resolve({host2, std::to_string(ports2_0[j])}));
|
|
|
|
- socketsP2.emplace_back(std::move(sb_a));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
for(size_t j = 0; j < number_of_sockets; ++j)
|
|
for(size_t j = 0; j < number_of_sockets; ++j)
|
|
{
|
|
{
|
|
tcp::socket sb_a(io_context);
|
|
tcp::socket sb_a(io_context);
|
|
@@ -69,16 +62,16 @@ void make_connections(bool& party, const std::string host1,
|
|
socketsPb[j] = std::move(sb_a);
|
|
socketsPb[j] = std::move(sb_a);
|
|
}
|
|
}
|
|
|
|
|
|
- #else
|
|
|
|
- party = true;
|
|
|
|
-
|
|
|
|
for(size_t j = 0; j < number_of_sockets; ++j)
|
|
for(size_t j = 0; j < number_of_sockets; ++j)
|
|
{
|
|
{
|
|
tcp::socket sb_a(io_context);
|
|
tcp::socket sb_a(io_context);
|
|
- boost::asio::connect(sb_a, resolver.resolve({host2, std::to_string(ports2_1[j])}));
|
|
+ boost::asio::connect(sb_a, resolver.resolve({host2, std::to_string(ports2_0[j])}));
|
|
socketsP2.emplace_back(std::move(sb_a));
|
|
socketsP2.emplace_back(std::move(sb_a));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ #else
|
|
|
|
+ party = true;
|
|
|
|
+
|
|
boost::asio::thread_pool pool_connections(number_of_sockets);
|
|
boost::asio::thread_pool pool_connections(number_of_sockets);
|
|
|
|
|
|
for(size_t j = 0; j < number_of_sockets; ++j)
|
|
for(size_t j = 0; j < number_of_sockets; ++j)
|
|
@@ -87,5 +80,12 @@ void make_connections(bool& party, const std::string host1,
|
|
}
|
|
}
|
|
|
|
|
|
pool_connections.join();
|
|
pool_connections.join();
|
|
|
|
+
|
|
|
|
+ for(size_t j = 0; j < number_of_sockets; ++j)
|
|
|
|
+ {
|
|
|
|
+ tcp::socket sb_a(io_context);
|
|
|
|
+ boost::asio::connect(sb_a, resolver.resolve({host2, std::to_string(ports2_1[j])}));
|
|
|
|
+ socketsP2.emplace_back(std::move(sb_a));
|
|
|
|
+ }
|
|
#endif
|
|
#endif
|
|
-}
|
|
+}
|