fix
This commit is contained in:
@@ -106,7 +106,7 @@ auto packet_client::check_version(std::uint32_t client_version,
|
|||||||
std::to_string(cfg_.api_port)));
|
std::to_string(cfg_.api_port)));
|
||||||
connect_timeout.disable();
|
connect_timeout.disable();
|
||||||
if (not is_socket_still_alive(cli.socket)) {
|
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);
|
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 {
|
auto packet_client::connect(client &cli) -> bool {
|
||||||
try {
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
|
try {
|
||||||
timeout connect_timeout(
|
timeout connect_timeout(
|
||||||
[&cli]() {
|
[&cli]() {
|
||||||
event_system::instance().raise<packet_client_timeout>("connect",
|
event_system::instance().raise<packet_client_timeout>("connect",
|
||||||
@@ -144,7 +145,7 @@ auto packet_client::connect(client &cli) -> bool {
|
|||||||
connect_timeout.disable();
|
connect_timeout.disable();
|
||||||
|
|
||||||
if (not is_socket_still_alive(cli.socket)) {
|
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);
|
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));
|
throw std::runtime_error("write failed|" + std::to_string(bytes_written));
|
||||||
}
|
}
|
||||||
offset += static_cast<std::uint32_t>(bytes_written);
|
offset += static_cast<std::uint32_t>(bytes_written);
|
||||||
read_timeout.reset();
|
write_timeout.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // namespace repertory
|
} // namespace repertory
|
||||||
|
|||||||
Reference in New Issue
Block a user