Problem on Win64, since double does not represent SOCKET_INVALID exactly.