(packet)
| 1186 | value: function onData(data) { |
| 1187 | var _this3 = this; |
| 1188 | var callback = function callback(packet) { |
| 1189 | // if its the first message we consider the transport open |
| 1190 | if ("opening" === _this3.readyState && packet.type === "open") { |
| 1191 | _this3.onOpen(); |
| 1192 | } |
| 1193 | // if its a close packet, we close the ongoing requests |
| 1194 | if ("close" === packet.type) { |
| 1195 | _this3.onClose({ |
| 1196 | description: "transport closed by the server" |
| 1197 | }); |
| 1198 | return false; |
| 1199 | } |
| 1200 | // otherwise bypass onData and handle the message |
| 1201 | _this3.onPacket(packet); |
| 1202 | }; |
| 1203 | // decode payload |
| 1204 | decodePayload(data, this.socket.binaryType).forEach(callback); |
| 1205 | // if an event did not trigger closing |
no test coverage detected