TsgcHTTPServer › Events › OnSendBufferFull
Fires when the outbound queue of a client connection has reached its configured limit, before the overflow policy is applied. Inherited from the shared server engine; see Remarks.
property OnSendBufferFull: TsgcWSSendBufferFullEvent;
// TsgcWSSendBufferFullEvent = procedure(Connection: TsgcWSConnection; const QueueSize: Integer; var DropMessage: Boolean) of object
—
OnSendBufferFull belongs to the same per-connection outbound queue mechanism used across the sgc server components: when queuing is enabled and a connection's queue already holds the configured maximum number of messages, this event is raised with the affected Connection and the current QueueSize, before the overflow policy (drop oldest, drop newest, or disconnect) is applied. TsgcHTTPServer does not publish the property that enables and configures this queue, and it never sends WebSocket messages through it, so in practice this event does not fire on this component; it remains published for interface compatibility with the other server components built on the same engine. DropMessage arrives as True, but since the condition that raises this event does not occur here, leaving it unchanged has no observable effect.
procedure OnSendBufferFull(Connection: TsgcWSConnection; const QueueSize: Integer;
var DropMessage: Boolean);
begin
WriteLn('#slow consumer ' + Connection.Guid + ': ' + IntToStr(QueueSize) + ' messages queued');
end;