                },
                    function (err) {
                        console.log("add2() error:", err);
                    }
            );

            x += 3;
        }, 1000);
    };


    // fired when connection was lost (or could not be established)
    //
    connection.onclose = function (reason, details) {
        console.log("Connection lost: " + reason);
        if (t1) {
            clearInterval(t1);
            t1 = null;
        }
        if (t2) {
            clearInterval(t2);
 