diff --git a/TCP.c b/TCP.c index d53ae64..c8e3d52 100644 --- a/TCP.c +++ b/TCP.c @@ -11,6 +11,8 @@ int open_tcp(char* ip, int port) { struct hostent *server; struct sockaddr_in serv_addr; + server = gethostbyname(ip); + if (server == NULL) { perror("Error resolving host"); exit(1);