Internet Direct (Indy) Version 9.0.1 Beta
TIdTCPConnection.WriteBuffer
Sends the data in a buffer to a peer connection.

procedure WriteBuffer(const ABuffer; AByteCount: Longint; const AWriteNow: boolean);
Parameters
const ABuffer
Buffer with data to be written.

AByteCount: Longint
Number of bytes of data to be written.

const AWriteNow: boolean = False
Ignore write buffering and send data immediately. Default value is False.

Description
WriteBuffer is a procedure that places data in the Indy buffer for the peer connection, or optionally sends the data to the peer connection. Note: This is the only place where data is sent to a peer through the socket binding allocated for a connection. All other write procedures call this method.

ABuffer is the TIdBuffer that contains data to be affected by WriteBuffer.

AByteCount is the number of bytes in the buffer to be affected by WriteBuffer.

When AWriteNow is True, write buffering will be ignored and ABuffer will be transmitted to the peer without updating the internal Indy write buffer. Note: If this is done after a call to OpenWriteBuffer, ABuffer will be transmitted before/in the middle of any data in the Indy internal write buffer.

Call OpenWriteBuffer to initiate use of Indy internal write buffering operations.

Call CancelWriteBuffer or CloseWriteBuffer to interrupt use of the internal Indy write buffer.

Call FlushWriteBuffer to force unsent data in the Indy internal write buffer to be sent to the peer connection.

Call ClearWriteBuffer to remove any unsent data in the Indy internal write buffer.