From 289b111105663cb95d3a0be56cb78aae0fd7f572 Mon Sep 17 00:00:00 2001 From: Joshua Moerman Date: Tue, 2 Apr 2013 21:00:38 +0200 Subject: [PATCH] poll is now explicit --- index.html | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 6a83c7a..6936f74 100644 --- a/index.html +++ b/index.html @@ -92,7 +92,7 @@ } function onOpen(evt) { - doSend(); + updateUser(); } function onMessage(evt) { @@ -104,7 +104,7 @@ updateLines(lines); setTimeout(function(){ - doSend(); + poll(); }, speed); } @@ -188,7 +188,7 @@ } } - function doSend(message) { + function updateUser() { var myself = { name: myName, size: {width: window.innerWidth, height: window.innerHeight} @@ -200,6 +200,13 @@ websocket.send(JSON.stringify(packet)); } + function poll(){ + var packet = { + command: 'poll' + }; + websocket.send(JSON.stringify(packet)); + } + function changeKind() { line_kind = line_kind + 1; line_kind = line_kind % 2;