TsgcWSAPIClient_MCPEvents › OnMCPPing

OnMCPPing Event

Fires when the server acknowledges a ping. Useful for round-trip telemetry.

Syntax

property OnMCPPing: TsgcAI_MCP_Client_OnPingEvent;
// TsgcAI_MCP_Client_OnPingEvent = procedure(Sender: TObject; const aRequest: TsgcAI_MCP_Request_Ping; const aResponse: TsgcAI_MCP_Response_Ping) of object

Default Value

Remarks

Raised after every successful Ping (manual or automatic via MCPOptions.HeartBeat). Use the handler to timestamp heartbeats, refresh connectivity indicators, or log the empty JSON-RPC result returned by the server.

Example

procedure TMainForm.MCPPing(Sender: TObject;
  const aRequest: TsgcAI_MCP_Request_Ping;
  const aResponse: TsgcAI_MCP_Response_Ping);
begin
  StatusBar.SimpleText := 'Server alive at ' + FormatDateTime('hh:nn:ss', Now);
end;

Back to Events