Edit throw text
This commit is contained in:
@@ -17,7 +17,7 @@ int Client::ping(struct sockaddr_in address){
|
|||||||
Client::Client(){
|
Client::Client(){
|
||||||
// Создание сокета
|
// Создание сокета
|
||||||
if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
|
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;
|
hostent* host_name;
|
||||||
host_name = gethostbyname(h.c_str()); // Преобразование названия хоста в IP-адрес.
|
host_name = gethostbyname(h.c_str()); // Преобразование названия хоста в IP-адрес.
|
||||||
if (host_name == nullptr) {
|
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);
|
serv_addr.sin_port = htons(p);
|
||||||
|
|||||||
Reference in New Issue
Block a user