p2p: close zone connections before stopping net servers

(cherry picked from commit b7ca9e73f23cfb0ce1e795b2074ad12af56b04e3)
This commit is contained in:
selsta
2026-10-04 18:50:20 -04:00
committed by such-gitea
parent 1e17dc299a
commit d171742ed6
4 changed files with 88 additions and 42 deletions
+4 -7
View File
@@ -801,14 +801,11 @@ TEST(boosted_tcp_server, shutdown)
server.get_config_object().handshake_received.wait();
}
// Now stop the server, providing the callback necessary to wait for all connections to shutdown
const auto close_all_connections = [&]()
{
server.get_config_object().close(context.m_connection_id, true/*wait_for_shutdown*/);
};
MINFO("Stopping the server");
server.send_stop_signal(close_all_connections);
server.mark_stop_signal_sent();
server.close_server_connections();
server.get_config_object().close(context.m_connection_id, true/*wait_for_shutdown*/);
server.stop_io_context();
running_server.join();
MINFO("Waiting for handshake to cancel");