use closesocket instead of close.