|
|
|
@ -153,6 +153,10 @@ export default class Websocket {
@@ -153,6 +153,10 @@ export default class Websocket {
|
|
|
|
|
pass it along to listeners. |
|
|
|
|
*/ |
|
|
|
|
onMessage(e) { |
|
|
|
|
// Optimization where multiple events can be sent within a
|
|
|
|
|
// single websocket message. So split them if needed.
|
|
|
|
|
var messages = e.data.split('\n'); |
|
|
|
|
for (var i = 0; i < messages.length; i++) { |
|
|
|
|
try { |
|
|
|
|
var model = JSON.parse(e.data); |
|
|
|
|
} catch (e) { |
|
|
|
@ -174,6 +178,7 @@ export default class Websocket {
@@ -174,6 +178,7 @@ export default class Websocket {
|
|
|
|
|
// Notify any of the listeners via the raw socket message callback.
|
|
|
|
|
this.notifyRawMessageListeners(model); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Reply to a PING as a keep alive.
|
|
|
|
|
sendPong() { |
|
|
|
|