use closesocket insteadof close on windows