Fix long polling
This commit is contained in:
parent
d646e3666f
commit
613ac2d6c3
|
|
@ -38,7 +38,7 @@
|
||||||
xhr.open('POST', url, true);
|
xhr.open('POST', url, true);
|
||||||
xhr.onreadystatechange = () => {
|
xhr.onreadystatechange = () => {
|
||||||
if (xhr.readyState == 4 && xhr.status == 200) {
|
if (xhr.readyState == 4 && xhr.status == 200) {
|
||||||
sock.onmessage(xhr.responseText);
|
sock.onmessage({ data: xhr.responseText });
|
||||||
poll(xhr);
|
poll(xhr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -69,7 +69,7 @@
|
||||||
|
|
||||||
sock.onopen();
|
sock.onopen();
|
||||||
|
|
||||||
poll(connectionId, new XMLHttpRequest());
|
poll(new XMLHttpRequest());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue