TsgcWSAPIServer_MCP › Methods › CloseSubscriptions

CloseSubscriptions Method

Gracefully closes every open subscriptions/listen stream.

Syntax

procedure CloseSubscriptions;

Remarks

Every subscription opened by a 2026-07-28 client receives its final response and the stream is closed, so the client knows the subscription ended on purpose. The method waits up to 3 seconds for the streams to finish. Call it before setting Server.Active to False; the component destructor calls it too. See Subscriptions.

Example

MCPServer.CloseSubscriptions;
MCPServer.Server.Active := False;

Back to Methods