projects
/
henge
/
kiak.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8a767de
)
minor bug fixes
author
jordan lavatai
<jordanlavatai@gmail.com>
Fri, 30 Jun 2017 04:32:59 +0000
(21:32 -0700)
committer
jordan lavatai
<jordanlavatai@gmail.com>
Fri, 30 Jun 2017 04:32:59 +0000
(21:32 -0700)
client.js
patch
|
blob
|
history
diff --git
a/client.js
b/client.js
index
85c139f
..
5607fa7
100644
(file)
--- a/
client.js
+++ b/
client.js
@@
-4,8
+4,13
@@
document.title = "Strapp.io Client"
body.appendChild(root)
document.body = body
body.appendChild(root)
document.body = body
+/*************/
+/* UNTESTED */
+/************
+
+
/* Poll the server. Send get request, wait for timeout, send another request.
/* 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()
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) {
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)
}
else {
reject('server errored out with ' + request.status)