TTMSMCPClientTransportSSE.Send Method
Posts one JSON-RPC message, given only its payload, to the address the server announced on the stream. 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.SSE
Declaring type: TTMSMCPClientTransportSSE
Overloads
Overload 1
Posts one JSON-RPC message, given only its payload, to the address the server announced on the stream. 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
Does nothing while that address is still unknown, which is the case until OnInitialized has been raised; the message is then discarded without notice. The post runs on the calling thread and blocks until the server has accepted the message. Only the stream request carries the headers and the connection handler the application supplies: a posted message is sent with its own plain connection, so OnHTTPCustomHeaders and OnCreateIOHandler are not raised for it. The reply to the post is not read either, because the answer to the message arrives on the event stream.
Parameters
| Name | Description |
|---|---|
AJsonRpc |
Message to send, already serialized as JSON. |
Overload 2
Posts 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 an event-stream connection has nowhere to carry that metadata.
procedure Send(const AJsonRpc: string; AMethod: string; ANameOrUri: string); overload; override;
Remarks
This channel carries no request metadata beside the payload, so the overload forwards 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. |