Table of Contents

TTMSMCPClientServers.LoadFromJSONFile Method

Replaces the collection with the server list stored in a configuration file, reading it as UTF-8.

API unit family: TMS.MCP.Client Declaring type: TTMSMCPClientServers

Overloads

Overload 1

Replaces the collection with the server list stored in a configuration file, reading it as UTF-8.

procedure LoadFromJSONFile(AFileName: string); overload;

Remarks

See the overload that takes an encoding for the behaviour and the file layout.

Parameters

Name Description
AFileName Full path of the file to read.

Overload 2

Replaces the collection with the server list stored in a configuration file.

procedure LoadFromJSONFile(AFileName: string; AEncoding: TEncoding); overload;

Remarks

Every entry already in the collection is stopped and removed first, so any reference to an earlier entry is invalid afterwards. Each object in the file may carry name, type (stdio, sse or http), command, args, env and url; an entry that carries an address while still typed as a standard-stream server is switched to the HTTP channel. Every entry that was read is started before the method returns, so connecting begins immediately. A file whose root is not an array leaves the collection empty rather than raising an error.

Parameters

Name Description
AFileName Full path of the file to read.
AEncoding Encoding the file is written in.