Fixed tcp_client

This commit is contained in:
gabime 2020-03-04 15:40:04 +02:00
parent 6095db951b
commit 8302086942

View File

@ -54,8 +54,8 @@ public:
void connect(const std::string &host, int port) void connect(const std::string &host, int port)
{ {
close(); close();
spdlog::info("Connecting.."); struct addrinfo hints
struct addrinfo hints{}; {};
memset(&hints, 0, sizeof(struct addrinfo)); memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_family = AF_INET; // IPv4 hints.ai_family = AF_INET; // IPv4
hints.ai_socktype = SOCK_STREAM; // TCP hints.ai_socktype = SOCK_STREAM; // TCP