(chunk, controller)
| 726 | |
| 727 | }, |
| 728 | transform(chunk, controller) { |
| 729 | // udp message 2 byte is the the length of udp data |
| 730 | // TODO: this should have bug, beacsue maybe udp chunk can be in two websocket message |
| 731 | for (let index = 0; index < chunk.byteLength;) { |
| 732 | const lengthBuffer = chunk.slice(index, index + 2); |
| 733 | const udpPakcetLength = new DataView(lengthBuffer).getUint16(0); |
| 734 | const udpData = new Uint8Array( |
| 735 | chunk.slice(index + 2, index + 2 + udpPakcetLength) |
| 736 | ); |
| 737 | index = index + 2 + udpPakcetLength; |
| 738 | controller.enqueue(udpData); |
| 739 | } |
| 740 | }, |
| 741 | flush(controller) { |
| 742 | } |
| 743 | }); |
nothing calls this directly
no outgoing calls
no test coverage detected