Sockets must be closed using closesocket in Windows

This commit is contained in:
jjgarcia 2008-08-19 11:44:23 +00:00
parent 4fc8b4e5f8
commit fdfe31a38c

View file

@ -137,7 +137,11 @@ int connect_to_server(char *host, int port)
#endif
start_critical_section();
if (connect(fd, addr, addrlen) == -1) {
#if defined(_MSC_VER) || defined(mingw32)
closesocket(fd);
#else
(void) close (fd);
#endif
end_critical_section();
return(0); /* errno set by system call. */
}