(packet)
| 979 | _proto.onData = function onData(data) { |
| 980 | var _this3 = this; |
| 981 | var callback = function callback(packet) { |
| 982 | // if its the first message we consider the transport open |
| 983 | if ("opening" === _this3.readyState && packet.type === "open") { |
| 984 | _this3.onOpen(); |
| 985 | } |
| 986 | // if its a close packet, we close the ongoing requests |
| 987 | if ("close" === packet.type) { |
| 988 | _this3.onClose({ |
| 989 | description: "transport closed by the server" |
| 990 | }); |
| 991 | return false; |
| 992 | } |
| 993 | // otherwise bypass onData and handle the message |
| 994 | _this3.onPacket(packet); |
| 995 | }; |
| 996 | // decode payload |
| 997 | decodePayload(data, this.socket.binaryType).forEach(callback); |
| 998 | // if an event did not trigger closing |
no test coverage detected