TsgcWSAPIClient_MCP › Events › OnMCPPing
Fires when the server acknowledges a ping. Useful for round-trip telemetry.
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
—
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.
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;