This commit is contained in:
2025-10-02 11:07:29 -05:00
parent 04307e0424
commit ac97afe46c

View File

@@ -106,7 +106,7 @@ auto packet_client::check_version(std::uint32_t client_version,
std::to_string(cfg_.api_port)));
connect_timeout.disable();
if (not is_socket_still_alive(cli.socket)) {
utils::error::raise_error(function_name, e, "failed to connect");
throw std::runtime_error("failed to connect");
}
comm::apply_common_socket_properties(cli.socket);
@@ -128,8 +128,9 @@ auto packet_client::check_version(std::uint32_t client_version,
}
auto packet_client::connect(client &cli) -> bool {
try {
REPERTORY_USES_FUNCTION_NAME();
try {
timeout connect_timeout(
[&cli]() {
event_system::instance().raise<packet_client_timeout>("connect",
@@ -144,7 +145,7 @@ auto packet_client::connect(client &cli) -> bool {
connect_timeout.disable();
if (not is_socket_still_alive(cli.socket)) {
utils::error::raise_error(function_name, e, "failed to connect");
throw std::runtime_error("failed to connect");
}
comm::apply_common_socket_properties(cli.socket);
@@ -417,7 +418,7 @@ void packet_client::write_data(client &cli, const packet &request) const {
throw std::runtime_error("write failed|" + std::to_string(bytes_written));
}
offset += static_cast<std::uint32_t>(bytes_written);
read_timeout.reset();
write_timeout.reset();
}
}
} // namespace repertory