Edit throw text

This commit is contained in:
2025-04-30 12:23:07 +02:00
parent 79fcae617e
commit 062f95492a

View File

@@ -17,7 +17,7 @@ int Client::ping(struct sockaddr_in address){
Client::Client(){
// Создание сокета
if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
throw std::runtime_error("[Client::request] connect(2) call error");
throw std::runtime_error("Error in socket create");
}
}
@@ -29,7 +29,7 @@ void Client::run(const std::string& h, const unsigned short p) {
hostent* host_name;
host_name = gethostbyname(h.c_str()); // Преобразование названия хоста в IP-адрес.
if (host_name == nullptr) {
throw std::runtime_error("Error in gethostbyname");
throw std::runtime_error("Error in get hostname");
}
serv_addr.sin_port = htons(p);