TsgcWSPServer_Dataset › Methods › WriteData
Sends a message to the connection identified by its Guid using the sgc envelope.
function WriteData(aGuid, aMessage: string): Boolean;
| Name | Type | Description |
|---|---|---|
aGuid | string | Connection Guid of the target client; pass a semicolon-separated list to reach several connections at once. |
aMessage | string | Text payload wrapped in a method=message envelope and surfaced on the client through its OnMessage event. |
True when the underlying transport accepts the message, False when no matching connection is found or the send fails (Boolean)
Unlike Publish and Broadcast, WriteData targets specific clients by Guid and bypasses the PubSub fan-out. The payload is wrapped in the sgc envelope (method=message) so recipients raise OnMessage, not OnBinary or OnEvent.
oProtocol.WriteData(aConnection.Guid, 'welcome');