           payload_size = parseInt($D('payload_size').value, 10);
            sendDelay = parseInt($D('sendDelay').value, 10);

            if ((!host) || (!port)) {
                console.log("must set host and port");
                return;
            }

            if (ws) {
                ws.close();
            }
            init_ws();

            // Populate payload data
            var numlist = []
            for (var i=0; i < payload_size; i++) {
                numlist.push( Math.floor(Math.r