(packets: Packet[])
| 88 | } |
| 89 | |
| 90 | protected write(packets: Packet[]) { |
| 91 | this.writable = false; |
| 92 | |
| 93 | for (let i = 0; i < packets.length; i++) { |
| 94 | const packet = packets[i]; |
| 95 | const lastPacket = i === packets.length - 1; |
| 96 | |
| 97 | this._writer.write(packet).then(() => { |
| 98 | if (lastPacket) { |
| 99 | nextTick(() => { |
| 100 | this.writable = true; |
| 101 | this.emitReserved(class="st">"drain"); |
| 102 | }, this.setTimeoutFn); |
| 103 | } |
| 104 | }); |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | protected doClose() { |
| 109 | this._transport?.close(); |