TTMSMCPClientTransportSTDIO.Send Method
Writes one JSON-RPC message, given only its payload, to the child process' standard input. This is the overload to call in the ordinary case, where the serialized message is all the caller has.
API unit family: TMS.MCP.Client.Transport.STDIO
Declaring type: TTMSMCPClientTransportSTDIO
Overloads
Overload 1
Writes one JSON-RPC message, given only its payload, to the child process' standard input. This is the overload to call in the ordinary case, where the serialized message is all the caller has.
procedure Send(const AJsonRpc: string); override;
Remarks
A line break is appended so that the server can read the message as one line. The call does not check that the process is running, and the write is simply lost when it is not. Any reply arrives separately through OnMessage. On platforms that write the line as single-byte text the payload is converted through the system's current 8-bit encoding, so a message carrying characters outside that encoding does not survive the conversion.
Parameters
| Name | Description |
|---|---|
AJsonRpc |
Message to send, already serialized as JSON. |
Overload 2
Writes one JSON-RPC message that additionally names the request it carries. Call it from code that drives every kind of channel through one call and therefore always supplies the method and target; on this channel the outcome is the same as the payload-only overload, because a pair of standard streams has nowhere to carry that metadata.
procedure Send(const AJsonRpc: string; AMethod: string; ANameOrUri: string); overload; override;
Remarks
A stream-based channel has no place to carry the request metadata separately, so this overload forwards the payload to the single-argument one and ignores the other two values.
Parameters
| Name | Description |
|---|---|
AJsonRpc |
Message to send, already serialized as JSON. |
AMethod |
Method name the message invokes. Not used by this channel. |
ANameOrUri |
Name or identifier of the target the method acts on. Not used by this channel. |