Closed shewu closed 7 years ago
there is no corresponding close(socketfd) to our creation.
close(socketfd)
int sockfd = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
in addition to closing, we should set sockfd to -1 afterwards.
sockfd
-1
there is no corresponding
close(socketfd)
to our creation.in addition to closing, we should set
sockfd
to-1
afterwards.