Internet Direct (Indy) Version 9.0.2 Beta
TIdTCPConnection.FlushWriteBuffer
Writes buffered data, and clears the write buffer in Indy.

procedure FlushWriteBuffer(const AByteCount: Integer);
Parameters
const AByteCount: Integer = -1
Threshold value for number of bytes to flush. Default value is -1.

Description
FlushWriteBuffer transmits all data which has been buffered since the call to the OpenWriteBuffer method to be sent to the peer. Buffered data is cleared after being sent to the peer connection. Write buffering remains active after the FlushWriteBuffer method is completed. Only CloseWriteBuffer and CancelWriteBuffer can be used to stop write buffering after a call to OpenWriteBuffer.

ABytes indicates the threshold value for the number of bytes that should be removed from the Indy buffer and sent to the peer socket connection. The default value (-1) forces all data in the Indy buffer to be written to the peer, and the write buffer is cleared using ClearWriteBuffer. This is also the case when the buffer is smaller than the threshold value in ABytes. Otherwise, the number of bytes in ABytes is removed from the Indy buffer and sent to the peer.