(chunk, controller)
| 650 | |
| 651 | }, |
| 652 | transform(chunk, controller) { |
| 653 | // udp message 2 byte is the the length of udp data |
| 654 | // TODO: this should have bug, beacsue maybe udp chunk can be in two websocket message |
| 655 | for (let index = 0; index < chunk.byteLength;) { |
| 656 | const lengthBuffer = chunk.slice(index, index + 2); |
| 657 | const udpPakcetLength = new DataView(lengthBuffer).getUint16(0); |
| 658 | const udpData = new Uint8Array( |
| 659 | chunk.slice(index + 2, index + 2 + udpPakcetLength) |
| 660 | ); |
| 661 | index = index + 2 + udpPakcetLength; |
| 662 | controller.enqueue(udpData); |
| 663 | } |
| 664 | }, |
| 665 | flush(controller) { |
| 666 | } |
| 667 | }); |
nothing calls this directly
no outgoing calls
no test coverage detected