X-Git-Url: https://git.kengrimes.com/?p=henge%2Fkiak.git;a=blobdiff_plain;f=client.js;h=5607fa7d194657f8ee2bfbb227ee5a1ebd488672;hp=85c139f0088f7c5e21354032d872914c9ae5b71a;hb=57d01d593d30b98cbba1d39a2ebb98fcc4e91bcb;hpb=8a767de924e57ea87bc2d0d0b9cf9864e523d916 diff --git a/client.js b/client.js index 85c139f..5607fa7 100644 --- a/client.js +++ b/client.js @@ -4,8 +4,13 @@ document.title = "Strapp.io Client" body.appendChild(root) document.body = body +/*************/ +/* UNTESTED */ +/************ + + /* Poll the server. Send get request, wait for timeout, send another request. - Do this until...? */ + Do this until...? Can be used for either reconnecting or waiting for answer*/ function pollServerTimeout(url, data, resolve, reject) { console.log('Polling server with offer ' + data) const request = XMLHttpRequest() @@ -17,7 +22,7 @@ function pollServerTimeout(url, data, resolve, reject) { resolve(request.response) } else if (request.status === 504) { - pollServerTimeout(url, resolve, reject) + pollServerTimeout(url, data, resolve, reject) } else { reject('server errored out with ' + request.status)