/** * Flushes content of the session buffer to the channel and updates transport metrics. * * @return number of bytes written to the channel. * * @since 4.3 */ protected int flushToChannel() throws IOException { if (!this.buffer.hasData()) { return 0; } final int bytesWritten = this.buffer.flush(this.channel); if (bytesWritten > 0) { this.metrics.incrementBytesTransferred(bytesWritten); } return bytesWritten; }
/** * Flushes content of the session buffer to the channel and updates transport metrics. * * @return number of bytes written to the channel. * * @since 4.3 */ protected int flushToChannel() throws IOException { if (!this.buffer.hasData()) { return 0; } final int bytesWritten = this.buffer.flush(this.channel); if (bytesWritten > 0) { this.metrics.incrementBytesTransferred(bytesWritten); } return bytesWritten; }