async retryHandshakeHelper(msg, options = {}) {
        if (options.retries > 100) { // undefined > 100 is false
            Logger.warn("Unable to reach vacuum. Giving up after 100 tries");

            throw new RetryWrapperSurrenderError(msg);
        }

        // ++undefined is NaN and NaN is falsy. See: https://stackoverflow.com/a/13298258
        options.retries = ++options.retries || 0;


        if (options.retries % 10 === 0 && options.retries >= 10) {
            // We may want to refresh the token from fs just to be sure
            let newToken = this.tokenProvider();

            if (!(this.miioSocket.codec.token.equals(newToken))) {
                Logger.info("Got an expired token. Changing to new");

                this.miioSocket.codec.setToken(newToken);
            } else {
                Logger.debug("Token is okay, however we're unable to reach the vacuum", {
                    retries: options.retries,
                    msg: msg
                });
            }

            // Also do another handshake just to be sure our stamp is correct.
            await this.handshake(true);
        }

        //remove all remains of a previous attempt
        delete(msg["id"]);
    }
This will either
- handshake and resolve
- increment the retry counter by modifying the options parameter and resolve
- throw if retrying doesn't make sense anymore

@private

@param {object?} msg JSON object to send to remote
@param {object} options
@param {number=} options.retries
@param {number=} options.timeout custom timeout in milliseconds
@returns {Promise<object>}