* Flush write buffers. * * @private
()
| 695 | * @private |
| 696 | */ |
| 697 | protected flush() { |
| 698 | if ( |
| 699 | "closed" !== this.readyState && |
| 700 | this.transport.writable && |
| 701 | !this.upgrading && |
| 702 | this.writeBuffer.length |
| 703 | ) { |
| 704 | const packets = this._getWritablePackets(); |
| 705 | debug("flushing %d packets in socket", packets.length); |
| 706 | this.transport.send(packets); |
| 707 | // keep track of current length of writeBuffer |
| 708 | // splice writeBuffer and callbackBuffer on `drain` |
| 709 | this._prevBufferLen = packets.length; |
| 710 | this.emitReserved("flush"); |
| 711 | } |
| 712 | } |
| 713 | |
| 714 | /** |
| 715 | * Ensure the encoded size of the writeBuffer is below the maxPayload value sent by the server (only for HTTP |
no test coverage detected