use closeSocket() on windows