(chunk, controller)
| 535 | |
| 536 | }, |
| 537 | transform(chunk, controller) { |
| 538 | // udp message 2 byte is the the length of udp data |
| 539 | // TODO: this should have bug, beacsue maybe udp chunk can be in two websocket message |
| 540 | for (let index = 0; index < chunk.byteLength;) { |
| 541 | const lengthBuffer = chunk.slice(index, index + 2); |
| 542 | const udpPakcetLength = new DataView(lengthBuffer).getUint16(0); |
| 543 | const udpData = new Uint8Array( |
| 544 | chunk.slice(index + 2, index + 2 + udpPakcetLength) |
| 545 | ); |
| 546 | index = index + 2 + udpPakcetLength; |
| 547 | controller.enqueue(udpData); |
| 548 | } |
| 549 | }, |
| 550 | flush(controller) { |
| 551 | } |
| 552 | }); |
nothing calls this directly
no outgoing calls
no test coverage detected